@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | if ($value === false) { |
132 | 132 | continue; |
133 | 133 | } |
134 | - $passOptionStr .= sprintf('--%s%s ', $key, is_bool($value) ? '' : ('=' . $value)); |
|
134 | + $passOptionStr .= sprintf('--%s%s ', $key, is_bool($value) ? '' : ('='.$value)); |
|
135 | 135 | } |
136 | - $statusCode = self::runArtisanCommand($this->basePath, trim('laravels config ' . $passOptionStr)); |
|
136 | + $statusCode = self::runArtisanCommand($this->basePath, trim('laravels config '.$passOptionStr)); |
|
137 | 137 | if ($statusCode !== 0) { |
138 | 138 | return $statusCode; |
139 | 139 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $config = $this->getConfig(); |
143 | 143 | |
144 | 144 | if (!$config['server']['ignore_check_pid'] && file_exists($config['server']['swoole']['pid_file'])) { |
145 | - $pid = (int)file_get_contents($config['server']['swoole']['pid_file']); |
|
145 | + $pid = (int) file_get_contents($config['server']['swoole']['pid_file']); |
|
146 | 146 | if ($pid > 0 && self::kill($pid, 0)) { |
147 | 147 | $this->warning(sprintf('Swoole[PID=%d] is already running.', $pid)); |
148 | 148 | return 1; |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | $basePath = dirname($pidFile); |
195 | 195 | $deleteFiles = [ |
196 | 196 | $pidFile, |
197 | - $basePath . '/laravels-custom-processes.pid', |
|
198 | - $basePath . '/laravels-timer-process.pid', |
|
197 | + $basePath.'/laravels-custom-processes.pid', |
|
198 | + $basePath.'/laravels-timer-process.pid', |
|
199 | 199 | ]; |
200 | 200 | foreach ($deleteFiles as $deleteFile) { |
201 | 201 | if (file_exists($deleteFile)) { |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | // Reload custom processes |
240 | - $pidFile = dirname($pidFile) . '/laravels-custom-processes.pid'; |
|
240 | + $pidFile = dirname($pidFile).'/laravels-custom-processes.pid'; |
|
241 | 241 | if (file_exists($pidFile)) { |
242 | - $pids = (array)explode("\n", trim(file_get_contents($pidFile))); |
|
242 | + $pids = (array) explode("\n", trim(file_get_contents($pidFile))); |
|
243 | 243 | unlink($pidFile); |
244 | 244 | foreach ($pids as $pid) { |
245 | 245 | if (!$pid || !self::kill($pid, 0)) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | // Reload timer process |
259 | 259 | if (!empty($config['server']['timer']['enable']) && !empty($config['server']['timer']['jobs'])) { |
260 | - $pidFile = dirname($pidFile) . '/laravels-timer-process.pid'; |
|
260 | + $pidFile = dirname($pidFile).'/laravels-timer-process.pid'; |
|
261 | 261 | $pid = file_get_contents($pidFile); |
262 | 262 | if (!$pid || !self::kill($pid, 0)) { |
263 | 263 | $this->error("Timer process[PID={$pid}] does not exist, or permission denied."); |
@@ -281,16 +281,16 @@ discard block |
||
281 | 281 | public function loadApollo(array $options) |
282 | 282 | { |
283 | 283 | Client::putCommandOptionsToEnv($options); |
284 | - $envFile = $this->basePath . '/.env'; |
|
284 | + $envFile = $this->basePath.'/.env'; |
|
285 | 285 | if (isset($options['env'])) { |
286 | - $envFile .= '.' . $options['env']; |
|
286 | + $envFile .= '.'.$options['env']; |
|
287 | 287 | } |
288 | 288 | Client::createFromCommandOptions($options)->pullAllAndSave($envFile); |
289 | 289 | } |
290 | 290 | |
291 | 291 | protected static function isLoadSwooleByIni() |
292 | 292 | { |
293 | - $iniFiles = explode(',', (string)php_ini_scanned_files()); |
|
293 | + $iniFiles = explode(',', (string) php_ini_scanned_files()); |
|
294 | 294 | $iniFile = php_ini_loaded_file(); |
295 | 295 | if ($iniFile !== false) { |
296 | 296 | $iniFiles[] = $iniFile; |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | if (!self::isLoadSwooleByIni()) { |
332 | 332 | $phpCmd .= ' -d "extension=swoole"'; |
333 | 333 | } |
334 | - return trim($phpCmd . ' ' . $subCmd); |
|
334 | + return trim($phpCmd.' '.$subCmd); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | public static function runArtisanCommand($basePath, $cmd) |
@@ -348,12 +348,12 @@ discard block |
||
348 | 348 | |
349 | 349 | public function getConfig() |
350 | 350 | { |
351 | - return unserialize((string)file_get_contents($this->getConfPath())); |
|
351 | + return unserialize((string) file_get_contents($this->getConfPath())); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | protected function getConfPath() |
355 | 355 | { |
356 | - return $this->basePath . '/storage/laravels.conf'; |
|
356 | + return $this->basePath.'/storage/laravels.conf'; |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | public static function runCommand($cmd, $input = null) |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | public static function kill($pid, $sig) |
375 | 375 | { |
376 | 376 | try { |
377 | - return Process::kill((int)$pid, $sig); |
|
377 | + return Process::kill((int) $pid, $sig); |
|
378 | 378 | } catch (\Exception $e) { |
379 | 379 | return false; |
380 | 380 | } |
@@ -19,17 +19,17 @@ |
||
19 | 19 | return false; |
20 | 20 | } |
21 | 21 | |
22 | - $fileTypes = isset($config['file_types']) ? (array)$config['file_types'] : []; |
|
22 | + $fileTypes = isset($config['file_types']) ? (array) $config['file_types'] : []; |
|
23 | 23 | if (empty($fileTypes)) { |
24 | 24 | $this->warning('No file types to watch by inotify'); |
25 | 25 | return false; |
26 | 26 | } |
27 | 27 | |
28 | - $callback = function () use ($config, $laravelConf) { |
|
28 | + $callback = function() use ($config, $laravelConf) { |
|
29 | 29 | $log = !empty($config['log']); |
30 | 30 | $this->setProcessTitle(sprintf('%s laravels: inotify process', $config['process_prefix'])); |
31 | 31 | $inotify = new Inotify($config['watch_path'], IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVE, |
32 | - function ($event) use ($log, $laravelConf) { |
|
32 | + function($event) use ($log, $laravelConf) { |
|
33 | 33 | Portal::runLaravelSCommand($laravelConf['root_path'], 'reload'); |
34 | 34 | if ($log) { |
35 | 35 | $action = 'file:'; |