[TASK] PSR-2

This commit is contained in:
Kanti 2014-12-17 11:31:43 +01:00
commit 5f6bf63760
2 changed files with 327 additions and 327 deletions

View file

@ -4,13 +4,15 @@ $updater = new Kanti\HubUpdater("danpros/htmly");
$info = $updater->getCurrentInfo();
$versionNumber = substr($info['tag_name'], 1);
function isGraterThan($string){
function isGraterThan($string)
{
global $versionNumber;
return (version_compare($versionNumber, $string) > 0);
}
// http://stackoverflow.com/questions/3338123/how-do-i-recursively-delete-a-directory-and-its-entire-contents-files-sub-dir
function rrmdir($dir) {
function rrmdir($dir)
{
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
@ -30,7 +32,5 @@ if(isGraterThan("2.3")) {// 2.4, 2.5, ...
}
}
if(isGraterThan("2.3")) {
file_put_contents("index.php", file_get_contents("system/upgrade/index.php"));
rrmdir("system/upgrade/");
}