Try to clear caches before updating (#522)
* Try to clear caches before updating * Add clear-compiled to maintenance cache list * Formatting
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Services\Installer;
|
||||
|
||||
use App\Contracts\Service;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Nwidart\Modules\Facades\Module;
|
||||
|
||||
class InstallerService extends Service
|
||||
@@ -38,6 +39,23 @@ class InstallerService extends Service
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear whatever caches we can by calling Artisan
|
||||
*/
|
||||
public function clearCaches(): void
|
||||
{
|
||||
$commands = [
|
||||
'clear-compiled',
|
||||
'cache:clear',
|
||||
'route:clear',
|
||||
'view:clear',
|
||||
];
|
||||
|
||||
foreach ($commands as $cmd) {
|
||||
Artisan::call($cmd);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the installer and importer modules
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user