1
0
mirror of https://github.com/flarum/core.git synced 2025-02-24 03:05:12 +01:00

Let extensions take care of flushing the formatter cache

This commit is contained in:
Franz Liedke 2018-09-26 23:11:27 +02:00
parent b823a9df47
commit 3b70b9e76e
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -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();
}
}