Browse Source

Replace some of Laravel's default service providers with simple bindings

pull/9/head
Franz Liedke 10 years ago
parent
commit
13b3e8e134
  1. 24
      system/bootstrap.php

24
system/bootstrap.php

@ -97,12 +97,31 @@ use Illuminate\Support\Facades\Facade;
Facade::clearResolvedInstances();
Facade::setFacadeApplication($app);
// Register some services
use Flarum\Core;
use Illuminate\Cache\FileStore;
use Illuminate\Cache\Repository;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Queue\Connectors\SyncConnector;
$app->singleton('cache.store', function($app) {
$store = new FileStore(new Filesystem(), storage_path('framework/cache'));
$repository = new Repository($store);
$repository->setEventDispatcher($app->make('events'));
return $repository;
});
$app->alias('cache.store', 'Illuminate\Contracts\Cache\Store');
$app->singleton('queue.connection', function($app) {
$connector = new SyncConnector();
return $connector->connect([]);
});
$app->alias('queue.connection', 'Illuminate\Contracts\Queue\Queue');
// RegisterProviders
$serviceProviders = [
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
@ -111,7 +130,6 @@ $serviceProviders = [
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',

Loading…
Cancel
Save