/** * Execute the console command. * * @return mixed */ public function fire() { $result = \Ngxcache::items(); if ($result->count == 0) { $this->comment('Cache directory is empty.'); } else { foreach ($result->files as $key => $value) { $this->info($key . '. ' . \Ngxcache::backtrace($value)); } $this->info('Caches has been hit.'); } }
/** * Execute the console command. * * @return mixed */ public function fire() { echo PHP_EOL; $this->error('Warning!'); if ($this->confirm('Do you want to rebuild by deleting the cache of all ? [y/N]', false)) { echo PHP_EOL; $this->comment('Display port number depends on the setting of the nginx.'); $info = \Ngxcache::items(); foreach ($info->files as $key => $file) { $current = \Ngxcache::backtrace($file); if ($current) { $this->info('cached. => ' . $current); $rebuild = \Ngxcache::rebuild($current, true); if ($rebuild->success) { $this->info($key . '. ' . $rebuild->cache); } else { $this->error('Writing error.'); } } else { $this->error("Source uri is unknown."); } } } }