mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-17 21:49:41 +01:00
fixes
This commit is contained in:
@@ -185,10 +185,18 @@ elseif ($current_smt == 'update2')
|
|||||||
$ex_folder = trim($zip->getNameIndex(0), '/');
|
$ex_folder = trim($zip->getNameIndex(0), '/');
|
||||||
$zip->extractTo(PATH . 'cache/');
|
$zip->extractTo(PATH . 'cache/');
|
||||||
$zip->close();
|
$zip->close();
|
||||||
rename(
|
if(rename(
|
||||||
PATH . "cache/{$ex_folder}" , // the name of the folder after extract it
|
PATH . "cache/{$ex_folder}",
|
||||||
PATH . "cache/kleeja-{$new_version}"
|
PATH . "cache/kleeja-{$new_version}"
|
||||||
);
|
) === false)
|
||||||
|
{
|
||||||
|
copy(
|
||||||
|
PATH . "cache/{$ex_folder}",
|
||||||
|
PATH . "cache/kleeja-{$new_version}"
|
||||||
|
);
|
||||||
|
|
||||||
|
kleeja_unlink(PATH . "cache/{$ex_folder}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// let's check if there any update files in install folder
|
// let's check if there any update files in install folder
|
||||||
@@ -198,7 +206,10 @@ elseif ($current_smt == 'update2')
|
|||||||
{
|
{
|
||||||
// move the update file from install folder to cache folder to include it later and delete install folder
|
// move the update file from install folder to cache folder to include it later and delete install folder
|
||||||
// becuse if install folder is exists , it can make some problems if dev mode is not active
|
// becuse if install folder is exists , it can make some problems if dev mode is not active
|
||||||
rename($update_file, PATH . 'cache/update_schema.php');
|
if(rename($update_file, PATH . 'cache/update_schema.php') === false)
|
||||||
|
{
|
||||||
|
copy($update_file, PATH . 'cache/update_schema.php');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip some folders
|
// skip some folders
|
||||||
@@ -282,10 +293,14 @@ elseif ($current_smt == 'update3')
|
|||||||
file_get_contents($file->getPathname())
|
file_get_contents($file->getPathname())
|
||||||
) === false)
|
) === false)
|
||||||
{
|
{
|
||||||
$update_failed = true;
|
|
||||||
array_push($failed_files, $file_path);
|
|
||||||
|
|
||||||
break;
|
if (copy($file->getPathname(), $file_path) === false)
|
||||||
|
{
|
||||||
|
$update_failed = true;
|
||||||
|
array_push($failed_files, $file_path);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($file->isDir())
|
elseif ($file->isDir())
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if (! defined('PATH'))
|
|||||||
{
|
{
|
||||||
define('__DIR__', dirname(__FILE__));
|
define('__DIR__', dirname(__FILE__));
|
||||||
}
|
}
|
||||||
define('PATH', str_replace(DIRECTORY_SEPARATOR . 'includes', '', __DIR__) . DIRECTORY_SEPARATOR);
|
define('PATH', str_replace('/includes', '', __DIR__) . '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
//no config
|
//no config
|
||||||
|
|||||||
Reference in New Issue
Block a user