mirror of
https://github.com/flarum/framework.git
synced 2025-02-08 18:02:59 +08:00
We don't need to make the cache adapter configurable like this
This commit is contained in:
parent
57df715ca7
commit
b7dae92acb
|
@ -86,11 +86,12 @@ abstract class AbstractServer
|
||||||
|
|
||||||
$this->registerLogger($app);
|
$this->registerLogger($app);
|
||||||
|
|
||||||
|
$this->registerCache($app);
|
||||||
|
|
||||||
$app->register('Flarum\Database\DatabaseServiceProvider');
|
$app->register('Flarum\Database\DatabaseServiceProvider');
|
||||||
$app->register('Flarum\Settings\SettingsServiceProvider');
|
$app->register('Flarum\Settings\SettingsServiceProvider');
|
||||||
$app->register('Flarum\Locale\LocaleServiceProvider');
|
$app->register('Flarum\Locale\LocaleServiceProvider');
|
||||||
$app->register('Illuminate\Bus\BusServiceProvider');
|
$app->register('Illuminate\Bus\BusServiceProvider');
|
||||||
$app->register('Illuminate\Cache\CacheServiceProvider');
|
|
||||||
$app->register('Illuminate\Filesystem\FilesystemServiceProvider');
|
$app->register('Illuminate\Filesystem\FilesystemServiceProvider');
|
||||||
$app->register('Illuminate\Hashing\HashServiceProvider');
|
$app->register('Illuminate\Hashing\HashServiceProvider');
|
||||||
$app->register('Illuminate\Mail\MailServiceProvider');
|
$app->register('Illuminate\Mail\MailServiceProvider');
|
||||||
|
@ -135,16 +136,6 @@ abstract class AbstractServer
|
||||||
'mail' => [
|
'mail' => [
|
||||||
'driver' => 'mail',
|
'driver' => 'mail',
|
||||||
],
|
],
|
||||||
'cache' => [
|
|
||||||
'default' => 'file',
|
|
||||||
'stores' => [
|
|
||||||
'file' => [
|
|
||||||
'driver' => 'file',
|
|
||||||
'path' => $app->storagePath().'/cache',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'prefix' => 'flarum',
|
|
||||||
],
|
|
||||||
'filesystems' => [
|
'filesystems' => [
|
||||||
'default' => 'local',
|
'default' => 'local',
|
||||||
'cloud' => 's3',
|
'cloud' => 's3',
|
||||||
|
@ -174,4 +165,24 @@ abstract class AbstractServer
|
||||||
$app->instance('log', $logger);
|
$app->instance('log', $logger);
|
||||||
$app->alias('log', 'Psr\Log\LoggerInterface');
|
$app->alias('log', 'Psr\Log\LoggerInterface');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Application $app
|
||||||
|
*/
|
||||||
|
protected function registerCache(Application $app)
|
||||||
|
{
|
||||||
|
$app->singleton('cache.store', function ($app) {
|
||||||
|
return new \Illuminate\Cache\Repository($app->make('cache.filestore'));
|
||||||
|
});
|
||||||
|
|
||||||
|
$app->singleton('cache.filestore', function ($app) {
|
||||||
|
return new \Illuminate\Cache\FileStore(
|
||||||
|
new \Illuminate\Filesystem\Filesystem(),
|
||||||
|
$app->storagePath().'/cache'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
$app->alias('cache.filestore', 'Illuminate\Contracts\Cache\Store');
|
||||||
|
$app->alias('cache.store', 'Illuminate\Contracts\Cache\Repository');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user