File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,30 @@ public function handle(Server $server): array
5151 );
5252
5353 return [
54- 'startup ' => json_decode ($ server ->egg ->inherit_config_startup ),
54+ 'startup ' => $ this -> convertStartupToNewFormat ( json_decode ($ server ->egg ->inherit_config_startup , true ) ),
5555 'stop ' => $ this ->convertStopToNewFormat ($ server ->egg ->inherit_config_stop ),
5656 'configs ' => $ configs ,
5757 ];
5858 }
5959
60+ /**
61+ * Convert the "done" variable into an array if it is not currently one.
62+ *
63+ * @param array $startup
64+ * @return array
65+ */
66+ protected function convertStartupToNewFormat (array $ startup )
67+ {
68+ $ done = Arr::get ($ startup , 'done ' );
69+
70+ return array_filter ([
71+ 'done ' => is_string ($ done ) ? [$ done ] : $ done ,
72+ 'user_interaction ' => Arr::get ($ startup , 'userInteraction ' ),
73+ ], function ($ datum ) {
74+ return ! is_null ($ datum );
75+ });
76+ }
77+
6078 /**
6179 * Converts a legacy stop string into a new generation stop option for a server.
6280 *
You can’t perform that action at this time.
0 commit comments