1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 16:05:05 +02:00

Split up Application and Container

- Stop trying to implement Laravel's Application contract, which
  has no value for us.
- Stop inheriting from the Container, injecting one works equally
  well and does not clutter up the interfaces.
- Inject the Paths collection instead of unwrapping it again, for
  better encapsulation.

This brings us one step closer toward upgrading our Laravel
components (#2055), because we no longer need to adopt the changes
to the Application contract.
This commit is contained in:
Franz Liedke
2020-05-01 09:53:55 +00:00
parent d0ae2839f0
commit 41a56c4ad1
16 changed files with 110 additions and 453 deletions

View File

@@ -24,7 +24,7 @@ class DatabaseServiceProvider extends AbstractServiceProvider
$this->app->singleton(Manager::class, function ($app) {
$manager = new Manager($app);
$config = $app->config('database');
$config = $this->app['flarum']->config('database');
$config['engine'] = 'InnoDB';
$config['prefix_indexes'] = true;

View File

@@ -10,7 +10,6 @@
namespace Flarum\Database;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Foundation\Application;
use Illuminate\Filesystem\Filesystem;
class MigrationServiceProvider extends AbstractServiceProvider
@@ -24,8 +23,11 @@ class MigrationServiceProvider extends AbstractServiceProvider
return new DatabaseMigrationRepository($app['flarum.db'], 'migrations');
});
$this->app->bind(MigrationCreator::class, function (Application $app) {
return new MigrationCreator($app->make(Filesystem::class), $app->basePath());
$this->app->bind(MigrationCreator::class, function () {
return new MigrationCreator(
$this->app->make(Filesystem::class),
$this->app->basePath()
);
});
}
}