@@ -41,6 +41,8 @@ class UpdateEnvironment extends Command
4141 {--dbuser=}
4242 {--dbpass=}
4343 {--url=}
44+ {--driver=}
45+ {--session-driver=}
4446 {--timezone=} ' ;
4547
4648 /**
@@ -126,8 +128,31 @@ public function handle()
126128 $ variables ['APP_TIMEZONE ' ] = $ this ->option ('timezone ' );
127129 }
128130
129- $ variables ['CACHE_DRIVER ' ] = 'memcached ' ;
130- $ variables ['SESSION_DRIVER ' ] = 'database ' ;
131+ if (is_null ($ this ->option ('driver ' ))) {
132+ $ this ->line ('If you chose redis as your cache driver backend, you *must* have a redis server configured already. ' );
133+ $ variables ['CACHE_DRIVER ' ] = $ this ->choice ('Which cache driver backend would you like to use? ' , [
134+ 'memcached ' => 'Memcache ' ,
135+ 'redis ' => 'Redis (recommended) ' ,
136+ 'apc ' => 'APC ' ,
137+ 'array ' => 'PHP Array ' ,
138+ ], config ('cache.default ' , 'memcached ' ));
139+ } else {
140+ $ variables ['CACHE_DRIVER ' ] = $ this ->option ('driver ' );
141+ }
142+
143+ if (is_null ($ this ->option ('session-driver ' ))) {
144+ $ this ->line ('If you chose redis as your cache driver backend, you *must* have a redis server configured already. ' );
145+ $ variables ['SESSION_DRIVER ' ] = $ this ->choice ('Which session driver backend would you like to use? ' , [
146+ 'database ' => 'MySQL (recommended) ' ,
147+ 'redis ' => 'Redis ' ,
148+ 'file ' => 'File ' ,
149+ 'cookie ' => 'Cookie ' ,
150+ 'apc ' => 'APC ' ,
151+ 'array ' => 'PHP Array ' ,
152+ ], config ('session.driver ' , 'database ' ));
153+ } else {
154+ $ variables ['SESSION_DRIVER ' ] = $ this ->option ('session-driver ' );
155+ }
131156
132157 $ bar = $ this ->output ->createProgressBar (count ($ variables ));
133158
0 commit comments