mirror of https://github.com/flarum/flarum
Change order of service providers
parent
f60c9d92ce
commit
46bd6b6232
|
@ -1,8 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Flarum\Core;
|
use Flarum\Core;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Zend\Diactoros\Server;
|
use Zend\Diactoros\Server;
|
||||||
use Zend\Stratigility\MiddlewarePipe;
|
use Zend\Stratigility\MiddlewarePipe;
|
||||||
|
|
||||||
|
|
2
api.php
2
api.php
|
@ -1,8 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Flarum\Core;
|
use Flarum\Core;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Zend\Diactoros\Server;
|
use Zend\Diactoros\Server;
|
||||||
use Zend\Stratigility\MiddlewarePipe;
|
use Zend\Stratigility\MiddlewarePipe;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ if (file_exists(__DIR__.'/core')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$app = new Flarum\Core\Application(
|
$app = new Flarum\Core\Application(
|
||||||
realpath(__DIR__)
|
realpath(__DIR__)
|
||||||
);
|
);
|
||||||
$app->instance('path.public', __DIR__.'/..');
|
$app->instance('path.public', __DIR__.'/..');
|
||||||
|
|
||||||
|
@ -18,47 +18,47 @@ Illuminate\Container\Container::setInstance($app);
|
||||||
|
|
||||||
// LoadConfiguration
|
// LoadConfiguration
|
||||||
if (file_exists($configFile = __DIR__.'/../config.php')) {
|
if (file_exists($configFile = __DIR__.'/../config.php')) {
|
||||||
$app->instance('flarum.config', include $configFile);
|
$app->instance('flarum.config', include $configFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
$app->instance('config', $config = new \Illuminate\Config\Repository([
|
$app->instance('config', $config = new \Illuminate\Config\Repository([
|
||||||
'view' => [
|
'view' => [
|
||||||
'paths' => [
|
'paths' => [
|
||||||
realpath(base_path('resources/views'))
|
realpath(base_path('resources/views'))
|
||||||
],
|
],
|
||||||
'compiled' => realpath(storage_path().'/framework/views'),
|
'compiled' => realpath(storage_path().'/framework/views'),
|
||||||
],
|
],
|
||||||
'mail' => [
|
'mail' => [
|
||||||
'driver' => 'smtp',
|
'driver' => 'smtp',
|
||||||
'host' => 'mailtrap.io',
|
'host' => 'mailtrap.io',
|
||||||
'port' => 25,
|
'port' => 25,
|
||||||
'from' => ['address' => 'noreply@flarum.org', 'name' => 'Flarum Demo Forum'],
|
'from' => ['address' => 'noreply@flarum.org', 'name' => 'Flarum Demo Forum'],
|
||||||
'encryption' => 'tls',
|
'encryption' => 'tls',
|
||||||
'username' => '3041435124c4c166c',
|
'username' => '',
|
||||||
'password' => 'a6949720835285',
|
'password' => '',
|
||||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||||
'pretend' => false,
|
'pretend' => false,
|
||||||
],
|
],
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'default' => 'file',
|
'default' => 'file',
|
||||||
'stores' => [
|
'stores' => [
|
||||||
'file' => [
|
'file' => [
|
||||||
'driver' => 'file',
|
'driver' => 'file',
|
||||||
'path' => storage_path().'/framework/cache',
|
'path' => storage_path().'/framework/cache',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'prefix' => 'flarum',
|
'prefix' => 'flarum',
|
||||||
],
|
],
|
||||||
'filesystems' => [
|
'filesystems' => [
|
||||||
'default' => 'local',
|
'default' => 'local',
|
||||||
'cloud' => 's3',
|
'cloud' => 's3',
|
||||||
'disks' => [
|
'disks' => [
|
||||||
'flarum-avatars' => [
|
'flarum-avatars' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => public_path('assets/avatars')
|
'root' => public_path('assets/avatars')
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
]));
|
]));
|
||||||
|
|
||||||
// ConfigureLogging
|
// ConfigureLogging
|
||||||
|
@ -78,38 +78,36 @@ use Illuminate\Cache\Repository;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
use Illuminate\Filesystem\Filesystem;
|
||||||
|
|
||||||
$app->singleton('cache', function($app) {
|
$app->singleton('cache', function($app) {
|
||||||
$store = new FileStore(new Filesystem(), storage_path('framework/cache'));
|
$store = new FileStore(new Filesystem(), storage_path('framework/cache'));
|
||||||
$repository = new Repository($store);
|
$repository = new Repository($store);
|
||||||
$repository->setEventDispatcher($app->make('events'));
|
$repository->setEventDispatcher($app->make('events'));
|
||||||
return $repository;
|
return $repository;
|
||||||
});
|
});
|
||||||
$app->alias('cache', 'Illuminate\Contracts\Cache\Repository');
|
$app->alias('cache', 'Illuminate\Contracts\Cache\Repository');
|
||||||
|
|
||||||
// RegisterProviders
|
// RegisterProviders
|
||||||
$serviceProviders = [
|
$serviceProviders = [
|
||||||
|
'Flarum\Core\DatabaseServiceProvider',
|
||||||
|
'Flarum\Core\Settings\SettingsServiceProvider',
|
||||||
|
'Flarum\Locale\LocaleServiceProvider',
|
||||||
|
|
||||||
'Illuminate\Bus\BusServiceProvider',
|
'Illuminate\Bus\BusServiceProvider',
|
||||||
'Illuminate\Filesystem\FilesystemServiceProvider',
|
'Illuminate\Filesystem\FilesystemServiceProvider',
|
||||||
'Illuminate\Hashing\HashServiceProvider',
|
'Illuminate\Hashing\HashServiceProvider',
|
||||||
'Illuminate\Events\EventServiceProvider',
|
|
||||||
'Illuminate\Mail\MailServiceProvider',
|
'Illuminate\Mail\MailServiceProvider',
|
||||||
'Illuminate\Validation\ValidationServiceProvider',
|
'Illuminate\View\ViewServiceProvider',
|
||||||
'Illuminate\View\ViewServiceProvider',
|
'Illuminate\Events\EventServiceProvider',
|
||||||
|
'Illuminate\Validation\ValidationServiceProvider',
|
||||||
'Flarum\Core\DatabaseServiceProvider',
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (Core::isInstalled()) {
|
if (Core::isInstalled()) {
|
||||||
$serviceProviders[] = 'Flarum\Core\Settings\SettingsServiceProvider';
|
|
||||||
$serviceProviders[] = 'Flarum\Locale\LocaleServiceProvider';
|
|
||||||
$serviceProviders[] = 'Flarum\Support\ExtensionsServiceProvider';
|
|
||||||
$serviceProviders[] = 'Flarum\Core\CoreServiceProvider';
|
$serviceProviders[] = 'Flarum\Core\CoreServiceProvider';
|
||||||
$serviceProviders[] = 'Flarum\Console\ConsoleServiceProvider';
|
$serviceProviders[] = 'Flarum\Console\ConsoleServiceProvider';
|
||||||
|
$serviceProviders[] = 'Flarum\Support\ExtensionsServiceProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($serviceProviders as $provider) {
|
foreach ($serviceProviders as $provider) {
|
||||||
$app->register(new $provider($app));
|
$app->register(new $provider($app));
|
||||||
}
|
}
|
||||||
|
|
||||||
// BootProviders
|
// BootProviders
|
||||||
|
|
Loading…
Reference in New Issue