Move cache:clear command to other namespace and actually flush the cache, too

Refs #837.
This commit is contained in:
Franz Liedke 2016-04-03 22:22:29 +09:00
parent ee8f4f04de
commit 729103c519
2 changed files with 19 additions and 2 deletions

View File

@ -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;

View File

@ -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)