mirror of
https://github.com/danpros/htmly.git
synced 2026-04-20 20:46:26 +05:30
[TASK] PSR-2
This commit is contained in:
parent
5483453e75
commit
5f6bf63760
2 changed files with 327 additions and 327 deletions
|
|
@ -2,20 +2,22 @@
|
|||
|
||||
$updater = new Kanti\HubUpdater("danpros/htmly");
|
||||
$info = $updater->getCurrentInfo();
|
||||
$versionNumber = substr($info['tag_name'],1);
|
||||
$versionNumber = substr($info['tag_name'], 1);
|
||||
|
||||
function isGraterThan($string){
|
||||
function isGraterThan($string)
|
||||
{
|
||||
global $versionNumber;
|
||||
return (version_compare($versionNumber,$string) > 0);
|
||||
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) {
|
||||
if ($object != "." && $object != "..") {
|
||||
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
|
||||
if (filetype($dir . "/" . $object) == "dir") rrmdir($dir . "/" . $object); else unlink($dir . "/" . $object);
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
|
|
@ -24,13 +26,11 @@ function rrmdir($dir) {
|
|||
}
|
||||
|
||||
//run upgrade specific stuff
|
||||
if(isGraterThan("2.3")) {// 2.4, 2.5, ...
|
||||
if(file_exists("vendor/")){
|
||||
if (isGraterThan("2.3")) {// 2.4, 2.5, ...
|
||||
if (file_exists("vendor/")) {
|
||||
rrmdir("vendor/");
|
||||
}
|
||||
}
|
||||
|
||||
if(isGraterThan("2.3")) {
|
||||
file_put_contents("index.php",file_get_contents("system/upgrade/index.php"));
|
||||
rrmdir("system/upgrade/");
|
||||
}
|
||||
file_put_contents("index.php", file_get_contents("system/upgrade/index.php"));
|
||||
rrmdir("system/upgrade/");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue