/** * Execute the console command. * * @return mixed */ public function fire() { $uri = $this->argument('uri'); $result = \Ngxcache::purge($uri, true); if ($result->success) { $this->info('0. ' . $result->cache); $this->info('Cache has been hit.'); } else { $this->error('0. ' . $result->cache); $this->error('No such cached file.'); } }
/** * Execute the console command. * * @return mixed */ public function fire() { $uri = $this->argument('uri'); $result = \Ngxcache::purge($uri); if ($result->success) { $this->info('0. ' . $result->cache); if ($result->config->debug) { $this->info('(Debug Mode) Cache has been hit.'); } else { $this->info('Cache has been removed.'); } } else { $this->error('0. ' . $result->cache); $this->error('No such cached file.'); } }
/** * Execute the console command. * * @return mixed */ public function fire($overwrite = false) { $uri = $this->argument('uri'); $result = \Ngxcache::rebuild($uri, $overwrite); if ($result->success) { $this->info('Rebuilding of the cache has been completed.'); $this->info('0. ' . $result->cache); } else { if ($result->status == 'exist') { $this->error('Cache has been exist.'); $this->error('0. ' . $result->cache); echo PHP_EOL; if ($this->confirm('Do you want to rebuild by deleting the cache ? [y/N]', false)) { \Ngxcache::purge($uri); $this->fire(true); } } else { $this->error('Writing error.'); } } }