mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
Move cache:clear command to other namespace and actually flush the cache, too
Refs #837.
This commit is contained in:
parent
ee8f4f04de
commit
729103c519
|
@ -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;
|
||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue
Block a user