1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +02:00

Don't resolve services when binding listeners

Refs #1578.
This commit is contained in:
Franz Liedke
2018-12-13 21:47:01 +01:00
parent cb3baf9955
commit ababb8ebef
6 changed files with 132 additions and 55 deletions

View File

@@ -30,6 +30,7 @@ use Flarum\Http\RouteHandlerFactory;
use Flarum\Http\UrlGenerator;
use Flarum\Locale\LocaleManager;
use Flarum\Settings\Event\Saved;
use Flarum\Settings\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Zend\Stratigility\MiddlewarePipe;
@@ -141,15 +142,26 @@ class ForumServiceProvider extends AbstractServiceProvider
$this->app->make(LocaleManager::class)
);
$recompile->whenSettingsSaved($event);
$validator = new ValidateCustomLess(
$this->app->make('flarum.assets.forum'),
$this->app->make('flarum.locales'),
$this->app
);
$validator->whenSettingsSaved($event);
}
);
$events->subscribe(
new ValidateCustomLess(
$this->app->make('flarum.assets.forum'),
$this->app->make('flarum.locales'),
$this->app
)
$events->listen(
Saving::class,
function (Saving $event) {
$validator = new ValidateCustomLess(
$this->app->make('flarum.assets.forum'),
$this->app->make('flarum.locales'),
$this->app
);
$validator->whenSettingsSaving($event);
}
);
}