mirror of
https://github.com/flarum/core.git
synced 2025-10-12 07:24:27 +02:00
Refactor the web app bootstrapping code
- All custom JS variables are now preloaded into the `app.data` object, rather than directly on the `app` object. This means that admin settings are available in `app.data.settings` rather than `app.settings`, etc. - Cleaner route handler generation - Renamed ConfigureClientView to ConfigureWebApp, though the former still exists and is deprecated - Partial fix for #881 (strips ?nojs=1 from URL if possible, so that refreshing will attempt to load JS version again)
This commit is contained in:
@@ -10,9 +10,9 @@
|
||||
|
||||
namespace Flarum\Debug\Console;
|
||||
|
||||
use Flarum\Admin\Controller\ClientController as AdminClient;
|
||||
use Flarum\Admin\WebApp as AdminWebApp;
|
||||
use Flarum\Console\Command\AbstractCommand;
|
||||
use Flarum\Forum\Controller\ClientController as ForumClient;
|
||||
use Flarum\Forum\WebApp as ForumWebApp;
|
||||
use Illuminate\Contracts\Cache\Store;
|
||||
|
||||
class CacheClearCommand extends AbstractCommand
|
||||
@@ -23,16 +23,21 @@ class CacheClearCommand extends AbstractCommand
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* @var \Flarum\Forum\Controller\ClientController
|
||||
* @var \Flarum\Forum\WebApp
|
||||
*/
|
||||
protected $forum;
|
||||
|
||||
/**
|
||||
* @var \Flarum\Admin\Controller\ClientController
|
||||
* @var \Flarum\Admin\WebApp
|
||||
*/
|
||||
protected $admin;
|
||||
|
||||
public function __construct(Store $cache, ForumClient $forum, AdminClient $admin)
|
||||
/**
|
||||
* @param Store $cache
|
||||
* @param ForumWebApp $forum
|
||||
* @param AdminWebApp $admin
|
||||
*/
|
||||
public function __construct(Store $cache, ForumWebApp $forum, AdminWebApp $admin)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->forum = $forum;
|
||||
@@ -58,8 +63,8 @@ class CacheClearCommand extends AbstractCommand
|
||||
{
|
||||
$this->info('Clearing the cache...');
|
||||
|
||||
$this->forum->flushAssets();
|
||||
$this->admin->flushAssets();
|
||||
$this->forum->getAssets()->flush();
|
||||
$this->admin->getAssets()->flush();
|
||||
|
||||
$this->cache->flush();
|
||||
}
|
||||
|
Reference in New Issue
Block a user