mirror of
https://github.com/flarum/core.git
synced 2025-08-01 06:00:24 +02:00
Inject new Paths class instead of Application
This (and similar work in other areas) will allow us to further reduce the API surface of the Application class. Separation of concerns etc.
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
namespace Flarum\Foundation\Console;
|
||||
|
||||
use Flarum\Console\AbstractCommand;
|
||||
use Flarum\Foundation\Application;
|
||||
use Flarum\Foundation\Event\ClearingCache;
|
||||
use Flarum\Foundation\Paths;
|
||||
use Illuminate\Contracts\Cache\Store;
|
||||
|
||||
class CacheClearCommand extends AbstractCommand
|
||||
@@ -22,18 +22,18 @@ class CacheClearCommand extends AbstractCommand
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* @var Application
|
||||
* @var Paths
|
||||
*/
|
||||
protected $app;
|
||||
protected $paths;
|
||||
|
||||
/**
|
||||
* @param Store $cache
|
||||
* @param Application $app
|
||||
* @param Paths $paths
|
||||
*/
|
||||
public function __construct(Store $cache, Application $app)
|
||||
public function __construct(Store $cache, Paths $paths)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->app = $app;
|
||||
$this->paths = $paths;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class CacheClearCommand extends AbstractCommand
|
||||
|
||||
$this->cache->flush();
|
||||
|
||||
$storagePath = $this->app->storagePath();
|
||||
$storagePath = $this->paths->storage;
|
||||
array_map('unlink', glob($storagePath.'/formatter/*'));
|
||||
array_map('unlink', glob($storagePath.'/locale/*'));
|
||||
|
||||
|
Reference in New Issue
Block a user