mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 04:31:08 -04:00
fix updater issue & add optimize clear cmd
This commit is contained in:
@ -30,8 +30,8 @@ class Updater
|
|||||||
|
|
||||||
$data = json_decode($data);
|
$data = json_decode($data);
|
||||||
|
|
||||||
if ($data->success && $data->version && $data->version->extensions) {
|
if ($data->success && $data->version && property_exists($data->version, 'extensions')) {
|
||||||
$extensions = $data->version->extensions;
|
$extensions = $data->version->extensions ?? [];
|
||||||
$extensionData = [];
|
$extensionData = [];
|
||||||
foreach (json_decode($extensions) as $extension) {
|
foreach (json_decode($extensions) as $extension) {
|
||||||
$extensionData[$extension] = phpversion($extension) ? true : false;
|
$extensionData[$extension] = phpversion($extension) ? true : false;
|
||||||
@ -118,7 +118,6 @@ class Updater
|
|||||||
|
|
||||||
public static function copyFiles($temp_extract_dir)
|
public static function copyFiles($temp_extract_dir)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!File::copyDirectory($temp_extract_dir . '/Crater', base_path())) {
|
if (!File::copyDirectory($temp_extract_dir . '/Crater', base_path())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -138,6 +137,8 @@ class Updater
|
|||||||
|
|
||||||
public static function finishUpdate($installed, $version)
|
public static function finishUpdate($installed, $version)
|
||||||
{
|
{
|
||||||
|
Artisan::call('optimize:clear');
|
||||||
|
|
||||||
event(new UpdateFinished($installed, $version));
|
event(new UpdateFinished($installed, $version));
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -146,5 +147,4 @@ class Updater
|
|||||||
'data' => []
|
'data' => []
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user