@@ -77,39 +77,31 @@ public function handle()
7777 $ envContents = file_get_contents ($ file );
7878
7979 $ this ->info ('Simply leave blank and press enter to fields that you do not wish to update. ' );
80- if (! env ( ' SERVICE_AUTHOR ' , false )) {
80+ if (is_null ( config ( ' pterodactyl.service.author ' , null ) )) {
8181 $ this ->info ('No service author set, setting one now. ' );
82- $ variables ['SERVICE_AUTHOR ' ] = env ('SERVICE_AUTHOR ' , (string ) Uuid::generate (4 ));
83- }
84-
85- if (! env ('QUEUE_STANDARD ' , false ) || ! env ('QUEUE_DRIVER ' , false )) {
86- $ this ->info ('Setting default queue settings. ' );
87- $ variables ['QUEUE_DRIVER ' ] = env ('QUEUE_DRIVER ' , 'database ' );
88- $ variables ['QUEUE_HIGH ' ] = env ('QUEUE_HIGH ' , 'high ' );
89- $ variables ['QUEUE_STANDARD ' ] = env ('QUEUE_STANDARD ' , 'standard ' );
90- $ variables ['QUEUE_LOW ' ] = env ('QUEUE_LOW ' , 'low ' );
82+ $ variables ['SERVICE_AUTHOR ' ] = (string ) Uuid::generate (4 );
9183 }
9284
9385 if (is_null ($ this ->option ('dbhost ' ))) {
94- $ variables ['DB_HOST ' ] = $ this ->anticipate ('Database Host ' , ['localhost ' , '127.0.0.1 ' , env ( ' DB_HOST ' )], env ( ' DB_HOST ' ));
86+ $ variables ['DB_HOST ' ] = $ this ->anticipate ('Database Host ' , ['localhost ' , '127.0.0.1 ' , config ( ' database.connections.mysql.host ' )], config ( ' database.connections.mysql.host ' ));
9587 } else {
9688 $ variables ['DB_HOST ' ] = $ this ->option ('dbhost ' );
9789 }
9890
9991 if (is_null ($ this ->option ('dbport ' ))) {
100- $ variables ['DB_PORT ' ] = $ this ->anticipate ('Database Port ' , [3306 , env ( ' DB_PORT ' )], env ( ' DB_PORT ' ));
92+ $ variables ['DB_PORT ' ] = $ this ->anticipate ('Database Port ' , [3306 , config ( ' database.connections.mysql.port ' )], config ( ' database.connections.mysql.port ' ));
10193 } else {
10294 $ variables ['DB_PORT ' ] = $ this ->option ('dbport ' );
10395 }
10496
10597 if (is_null ($ this ->option ('dbname ' ))) {
106- $ variables ['DB_DATABASE ' ] = $ this ->anticipate ('Database Name ' , ['pterodactyl ' , 'homestead ' , ENV ( ' DB_DATABASE ' )], env ( ' DB_DATABASE ' ));
98+ $ variables ['DB_DATABASE ' ] = $ this ->anticipate ('Database Name ' , ['pterodactyl ' , 'homestead ' , config ( ' database.connections.mysql.database ' )], config ( ' database.connections.mysql.database ' ));
10799 } else {
108100 $ variables ['DB_DATABASE ' ] = $ this ->option ('dbname ' );
109101 }
110102
111103 if (is_null ($ this ->option ('dbuser ' ))) {
112- $ variables ['DB_USERNAME ' ] = $ this ->anticipate ('Database Username ' , [ENV ( ' DB_DATABASE ' )], env ( ' DB_USERNAME ' ));
104+ $ variables ['DB_USERNAME ' ] = $ this ->anticipate ('Database Username ' , [config ( ' database.connections.mysql.username ' )], config ( ' database.connections.mysql.username ' ));
113105 } else {
114106 $ variables ['DB_USERNAME ' ] = $ this ->option ('dbuser ' );
115107 }
@@ -122,25 +114,23 @@ public function handle()
122114 }
123115
124116 if (is_null ($ this ->option ('url ' ))) {
125- $ variables ['APP_URL ' ] = $ this ->ask ('Panel URL (include http(s)://) ' , env ( ' APP_URL ' ));
117+ $ variables ['APP_URL ' ] = $ this ->ask ('Panel URL (include http(s)://) ' , config ( ' app.url ' ));
126118 } else {
127119 $ variables ['APP_URL ' ] = $ this ->option ('url ' );
128120 }
129121
130122 if (is_null ($ this ->option ('timezone ' ))) {
131123 $ this ->line ('The timezone should match one of the supported timezones according to http://php.net/manual/en/timezones.php ' );
132- $ variables ['APP_TIMEZONE ' ] = $ this ->anticipate ('Panel Timezone ' , \DateTimeZone::listIdentifiers (\DateTimeZone::ALL ), env ( ' APP_TIMEZONE ' ));
124+ $ variables ['APP_TIMEZONE ' ] = $ this ->anticipate ('Panel Timezone ' , \DateTimeZone::listIdentifiers (\DateTimeZone::ALL ), config ( ' app.timezone ' ));
133125 } else {
134126 $ variables ['APP_TIMEZONE ' ] = $ this ->option ('timezone ' );
135127 }
136128
137- $ variables ['APP_THEME ' ] = 'pterodactyl ' ;
138129 $ variables ['CACHE_DRIVER ' ] = 'memcached ' ;
139130 $ variables ['SESSION_DRIVER ' ] = 'database ' ;
140131
141132 $ bar = $ this ->output ->createProgressBar (count ($ variables ));
142133
143- $ this ->line ('Writing new environment configuration to file. ' );
144134 foreach ($ variables as $ key => $ value ) {
145135 $ newValue = $ key . '= ' . $ value ;
146136
@@ -155,8 +145,7 @@ public function handle()
155145 file_put_contents ($ file , $ envContents );
156146 $ bar ->finish ();
157147
158- $ this ->line ('Updating evironment configuration cache file. ' );
159148 $ this ->call ('config:cache ' );
160- echo "\n" ;
149+ $ this -> line ( "\n" ) ;
161150 }
162151}
0 commit comments