Better support for redis as a backend

This commit is contained in:
Dane Everitt 2017-04-01 16:31:18 -04:00
parent cbeecfe5e4
commit 0a95d97d7f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 31 additions and 10 deletions

View file

@ -41,6 +41,8 @@ class UpdateEnvironment extends Command
{--dbuser=}
{--dbpass=}
{--url=}
{--driver=}
{--session-driver=}
{--timezone=}';
/**
@ -126,8 +128,31 @@ class UpdateEnvironment extends Command
$variables['APP_TIMEZONE'] = $this->option('timezone');
}
$variables['CACHE_DRIVER'] = 'memcached';
$variables['SESSION_DRIVER'] = 'database';
if (is_null($this->option('driver'))) {
$this->line('If you chose redis as your cache driver backend, you *must* have a redis server configured already.');
$variables['CACHE_DRIVER'] = $this->choice('Which cache driver backend would you like to use?', [
'memcached' => 'Memcache',
'redis' => 'Redis (recommended)',
'apc' => 'APC',
'array' => 'PHP Array',
], config('cache.default', 'memcached'));
} else {
$variables['CACHE_DRIVER'] = $this->option('driver');
}
if (is_null($this->option('session-driver'))) {
$this->line('If you chose redis as your cache driver backend, you *must* have a redis server configured already.');
$variables['SESSION_DRIVER'] = $this->choice('Which session driver backend would you like to use?', [
'database' => 'MySQL (recommended)',
'redis' => 'Redis',
'file' => 'File',
'cookie' => 'Cookie',
'apc' => 'APC',
'array' => 'PHP Array',
], config('session.driver', 'database'));
} else {
$variables['SESSION_DRIVER'] = $this->option('session-driver');
}
$bar = $this->output->createProgressBar(count($variables));

View file

@ -45,7 +45,6 @@ return [
*/
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
@ -58,7 +57,6 @@ return [
'prefix' => '',
'strict' => false,
],
],
/*
@ -86,15 +84,13 @@ return [
*/
'redis' => [
'cluster' => false,
'client' => 'predis',
'default' => [
'host' => '127.0.0.1',
'port' => 6379,
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];