Updates for self updater

This commit is contained in:
David Bomba 2022-04-14 21:51:25 +10:00
parent e8e8598fd8
commit 62e0e2e466

View File

@ -21,6 +21,15 @@ class SelfUpdateController extends BaseController
{ {
use DispatchesJobs; use DispatchesJobs;
private array $purge_file_list = [
'bootstrap/cache/compiled.php',
'bootstrap/cache/config.php',
'bootstrap/cache/packages.php',
'bootstrap/cache/services.php',
'bootstrap/cache/routes-v7.php',
'bootstrap/cache/livewire-components.php',
];
public function __construct() public function __construct()
{ {
} }
@ -117,10 +126,12 @@ class SelfUpdateController extends BaseController
unlink($file); unlink($file);
$cacheCompiled = base_path('bootstrap/cache/compiled.php'); foreach($this->purge_file_list as $purge_file_path)
if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } {
$cacheServices = base_path('bootstrap/cache/services.php'); $purge_file = base_path($purge_file_path);
if (file_exists($cacheServices)) { unlink ($cacheServices); } if (file_exists($purge_file)) { unlink ($purge_file); }
}
Artisan::call('clear-compiled'); Artisan::call('clear-compiled');
Artisan::call('route:clear'); Artisan::call('route:clear');