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

Rename app to container (#2609)

* Rename `app` helper to `resolve`, deprecate old version
* Rename $this->app to $this->container in service providers

We no longer couple Flarum\Foundation\Application to the Laravel container; instead, we use the container separately. Changing our naming to reflect that will make things clearer.
This commit is contained in:
Alexander Skvortsov
2021-03-04 22:14:48 -05:00
committed by GitHub
parent 15cbe4daaa
commit c81f629b0b
29 changed files with 306 additions and 278 deletions

View File

@@ -19,15 +19,15 @@ class ExtensionServiceProvider extends AbstractServiceProvider
*/
public function register()
{
$this->app->singleton(ExtensionManager::class);
$this->app->alias(ExtensionManager::class, 'flarum.extensions');
$this->container->singleton(ExtensionManager::class);
$this->container->alias(ExtensionManager::class, 'flarum.extensions');
// Boot extensions when the app is booting. This must be done as a boot
// listener on the app rather than in the service provider's boot method
// below, so that extensions have a chance to register things on the
// container before the core boots up (and starts resolving services).
$this->app['flarum']->booting(function () {
$this->app->make('flarum.extensions')->extend($this->app);
$this->container['flarum']->booting(function () {
$this->container->make('flarum.extensions')->extend($this->container);
});
}
@@ -36,7 +36,7 @@ class ExtensionServiceProvider extends AbstractServiceProvider
*/
public function boot()
{
$this->app->make('events')->listen(
$this->container->make('events')->listen(
Disabling::class,
DefaultLanguagePackGuard::class
);