diff --git a/src/Console/Server.php b/src/Console/Server.php index 9892a8122..38f1c94a3 100644 --- a/src/Console/Server.php +++ b/src/Console/Server.php @@ -11,9 +11,9 @@ namespace Flarum\Console; -use Flarum\Console\Command\CacheClearCommand; use Flarum\Console\Command\GenerateExtensionCommand; use Flarum\Console\Command\GenerateMigrationCommand; +use Flarum\Debug\Console\CacheClearCommand; use Flarum\Debug\Console\InfoCommand; use Flarum\Foundation\AbstractServer; use Flarum\Install\Console\InstallCommand; diff --git a/src/Console/Command/CacheClearCommand.php b/src/Debug/Console/CacheClearCommand.php similarity index 74% rename from src/Console/Command/CacheClearCommand.php rename to src/Debug/Console/CacheClearCommand.php index 7ce3feb71..aebff46e0 100644 --- a/src/Console/Command/CacheClearCommand.php +++ b/src/Debug/Console/CacheClearCommand.php @@ -8,10 +8,25 @@ * file that was distributed with this source code. */ -namespace Flarum\Console\Command; +namespace Flarum\Debug\Console; + +use Flarum\Console\Command\AbstractCommand; +use Illuminate\Contracts\Cache\Store; class CacheClearCommand extends AbstractCommand { + /** + * @var \Illuminate\Contracts\Cache\Store + */ + protected $cache; + + public function __construct(Store $cache) + { + $this->cache = $cache; + + parent::__construct(); + } + /** * {@inheritdoc} */ @@ -31,6 +46,8 @@ class CacheClearCommand extends AbstractCommand $this->removeFilesMatching('assets', '*.js'); $this->removeFilesMatching('assets', '*.css'); + + $this->cache->flush(); } protected function removeFilesMatching($path, $pattern)