mirror of
https://github.com/flarum/framework.git
synced 2025-02-25 05:23:37 +08:00
Let extensions take care of flushing the formatter cache
This commit is contained in:
parent
5610824e96
commit
101cb1255d
@ -11,23 +11,11 @@
|
||||
|
||||
namespace Flarum\Formatter;
|
||||
|
||||
use Flarum\Extension\Event\Disabled;
|
||||
use Flarum\Extension\Event\Enabled;
|
||||
use Flarum\Foundation\AbstractServiceProvider;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class FormatterServiceProvider extends AbstractServiceProvider
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function boot(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Enabled::class, [$this, 'flushFormatter']);
|
||||
$events->listen(Disabled::class, [$this, 'flushFormatter']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -43,9 +31,4 @@ class FormatterServiceProvider extends AbstractServiceProvider
|
||||
|
||||
$this->app->alias('flarum.formatter', Formatter::class);
|
||||
}
|
||||
|
||||
public function flushFormatter()
|
||||
{
|
||||
$this->app->make('flarum.formatter')->flush();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user