Commit f26de20d by haojie

1

parent 2cfbd446
...@@ -17,3 +17,20 @@ ...@@ -17,3 +17,20 @@
Artisan::command('inspire', function () { Artisan::command('inspire', function () {
$this->comment(Inspiring::quote()); $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote'); })->purpose('Display an inspiring quote');
// 清除 opcache 全部缓存
Artisan::command('clear-all:opcache', function () {
opcache_reset();
$this->comment('OPcache 所有缓存已清除');
})->purpose('Clear all OPcache');
// 清除掉最近一次更新文件的缓存
Artisan::command('clear:opcache', function () {
exec('git diff --name-only HEAD~ HEAD', $output);
foreach ($output as $file) {
$path = base_path($file);
opcache_invalidate($path, true);
}
dd('刷新完成');
})->purpose('Clear OPcache');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment