@@ -19,21 +19,21 @@ class AppSettingsCommand extends Command
1919{
2020 use EnvironmentWriterTrait;
2121
22- const ALLOWED_CACHE_DRIVERS = [
22+ public const ALLOWED_CACHE_DRIVERS = [
2323 'redis ' => 'Redis (recommended) ' ,
2424 'memcached ' => 'Memcached ' ,
2525 'file ' => 'Filesystem ' ,
2626 ];
2727
28- const ALLOWED_SESSION_DRIVERS = [
28+ public const ALLOWED_SESSION_DRIVERS = [
2929 'redis ' => 'Redis (recommended) ' ,
3030 'memcached ' => 'Memcached ' ,
3131 'database ' => 'MySQL Database ' ,
3232 'file ' => 'Filesystem ' ,
3333 'cookie ' => 'Cookie ' ,
3434 ];
3535
36- const ALLOWED_QUEUE_DRIVERS = [
36+ public const ALLOWED_QUEUE_DRIVERS = [
3737 'redis ' => 'Redis (recommended) ' ,
3838 'database ' => 'MySQL Database ' ,
3939 'sync ' => 'Sync ' ,
@@ -77,9 +77,6 @@ class AppSettingsCommand extends Command
7777
7878 /**
7979 * AppSettingsCommand constructor.
80- *
81- * @param \Illuminate\Contracts\Config\Repository $config
82- * @param \Illuminate\Contracts\Console\Kernel $command
8380 */
8481 public function __construct (ConfigRepository $ config , Kernel $ command )
8582 {
@@ -102,43 +99,45 @@ public function handle()
10299
103100 $ this ->output ->comment (trans ('command/messages.environment.app.author_help ' ));
104101 $ this ->variables ['APP_SERVICE_AUTHOR ' ] = $ this ->option ('author ' ) ?? $ this ->ask (
105- trans ('command/messages.environment.app.author ' ), $ this ->config ->get ('pterodactyl.service.author ' , 'unknown@unknown.com ' )
106- );
102+ trans ('command/messages.environment.app.author ' ),
103+ $ this ->config ->get ('pterodactyl.service.author ' , 'unknown@unknown.com ' )
104+ );
107105
108106 $ this ->output ->comment (trans ('command/messages.environment.app.app_url_help ' ));
109107 $ this ->variables ['APP_URL ' ] = $ this ->option ('url ' ) ?? $ this ->ask (
110- trans ('command/messages.environment.app.app_url ' ), $ this ->config ->get ('app.url ' , 'http://example.org ' )
111- );
108+ trans ('command/messages.environment.app.app_url ' ),
109+ $ this ->config ->get ('app.url ' , 'http://example.org ' )
110+ );
112111
113112 $ this ->output ->comment (trans ('command/messages.environment.app.timezone_help ' ));
114113 $ this ->variables ['APP_TIMEZONE ' ] = $ this ->option ('timezone ' ) ?? $ this ->anticipate (
115- trans ('command/messages.environment.app.timezone ' ),
116- DateTimeZone::listIdentifiers (DateTimeZone::ALL ),
117- $ this ->config ->get ('app.timezone ' )
118- );
114+ trans ('command/messages.environment.app.timezone ' ),
115+ DateTimeZone::listIdentifiers (DateTimeZone::ALL ),
116+ $ this ->config ->get ('app.timezone ' )
117+ );
119118
120119 $ selected = $ this ->config ->get ('cache.default ' , 'redis ' );
121120 $ this ->variables ['CACHE_DRIVER ' ] = $ this ->option ('cache ' ) ?? $ this ->choice (
122- trans ('command/messages.environment.app.cache_driver ' ),
123- self ::ALLOWED_CACHE_DRIVERS ,
124- array_key_exists ($ selected , self ::ALLOWED_CACHE_DRIVERS ) ? $ selected : null
125- );
121+ trans ('command/messages.environment.app.cache_driver ' ),
122+ self ::ALLOWED_CACHE_DRIVERS ,
123+ array_key_exists ($ selected , self ::ALLOWED_CACHE_DRIVERS ) ? $ selected : null
124+ );
126125
127126 $ selected = $ this ->config ->get ('session.driver ' , 'redis ' );
128127 $ this ->variables ['SESSION_DRIVER ' ] = $ this ->option ('session ' ) ?? $ this ->choice (
129- trans ('command/messages.environment.app.session_driver ' ),
130- self ::ALLOWED_SESSION_DRIVERS ,
131- array_key_exists ($ selected , self ::ALLOWED_SESSION_DRIVERS ) ? $ selected : null
132- );
128+ trans ('command/messages.environment.app.session_driver ' ),
129+ self ::ALLOWED_SESSION_DRIVERS ,
130+ array_key_exists ($ selected , self ::ALLOWED_SESSION_DRIVERS ) ? $ selected : null
131+ );
133132
134133 $ selected = $ this ->config ->get ('queue.default ' , 'redis ' );
135134 $ this ->variables ['QUEUE_CONNECTION ' ] = $ this ->option ('queue ' ) ?? $ this ->choice (
136- trans ('command/messages.environment.app.queue_driver ' ),
137- self ::ALLOWED_QUEUE_DRIVERS ,
138- array_key_exists ($ selected , self ::ALLOWED_QUEUE_DRIVERS ) ? $ selected : null
139- );
135+ trans ('command/messages.environment.app.queue_driver ' ),
136+ self ::ALLOWED_QUEUE_DRIVERS ,
137+ array_key_exists ($ selected , self ::ALLOWED_QUEUE_DRIVERS ) ? $ selected : null
138+ );
140139
141- if (! is_null ($ this ->option ('settings-ui ' ))) {
140+ if (!is_null ($ this ->option ('settings-ui ' ))) {
142141 $ this ->variables ['APP_ENVIRONMENT_ONLY ' ] = $ this ->option ('settings-ui ' ) == 'true ' ? 'false ' : 'true ' ;
143142 } else {
144143 $ this ->variables ['APP_ENVIRONMENT_ONLY ' ] = $ this ->confirm (trans ('command/messages.environment.app.settings ' ), true ) ? 'false ' : 'true ' ;
@@ -171,28 +170,30 @@ private function checkForRedis()
171170
172171 $ this ->output ->note (trans ('command/messages.environment.app.using_redis ' ));
173172 $ this ->variables ['REDIS_HOST ' ] = $ this ->option ('redis-host ' ) ?? $ this ->ask (
174- trans ('command/messages.environment.app.redis_host ' ), $ this ->config ->get ('database.redis.default.host ' )
175- );
173+ trans ('command/messages.environment.app.redis_host ' ),
174+ $ this ->config ->get ('database.redis.default.host ' )
175+ );
176176
177177 $ askForRedisPassword = true ;
178- if (! empty ($ this ->config ->get ('database.redis.default.password ' ))) {
178+ if (!empty ($ this ->config ->get ('database.redis.default.password ' ))) {
179179 $ this ->variables ['REDIS_PASSWORD ' ] = $ this ->config ->get ('database.redis.default.password ' );
180180 $ askForRedisPassword = $ this ->confirm (trans ('command/messages.environment.app.redis_pass_defined ' ));
181181 }
182182
183183 if ($ askForRedisPassword ) {
184184 $ this ->output ->comment (trans ('command/messages.environment.app.redis_pass_help ' ));
185185 $ this ->variables ['REDIS_PASSWORD ' ] = $ this ->option ('redis-pass ' ) ?? $ this ->output ->askHidden (
186- trans ('command/messages.environment.app.redis_password ' )
187- );
186+ trans ('command/messages.environment.app.redis_password ' )
187+ );
188188 }
189189
190190 if (empty ($ this ->variables ['REDIS_PASSWORD ' ])) {
191191 $ this ->variables ['REDIS_PASSWORD ' ] = 'null ' ;
192192 }
193193
194194 $ this ->variables ['REDIS_PORT ' ] = $ this ->option ('redis-port ' ) ?? $ this ->ask (
195- trans ('command/messages.environment.app.redis_port ' ), $ this ->config ->get ('database.redis.default.port ' )
196- );
195+ trans ('command/messages.environment.app.redis_port ' ),
196+ $ this ->config ->get ('database.redis.default.port ' )
197+ );
197198 }
198199}
0 commit comments