@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | self::autoload($this->conf['root_path']); |
| 83 | 83 | |
| 84 | 84 | // Make kernel for Laravel |
| 85 | - $app = require $this->conf['root_path'] . '/bootstrap/app.php'; |
|
| 85 | + $app = require $this->conf['root_path'].'/bootstrap/app.php'; |
|
| 86 | 86 | $kernel = $this->conf['is_lumen'] ? null : $app->make(HttpKernel::class); |
| 87 | 87 | |
| 88 | 88 | // Boot |
@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | $cfgPaths = [ |
| 104 | 104 | // Framework default configuration |
| 105 | - $this->conf['root_path'] . '/vendor/laravel/lumen-framework/config/', |
|
| 105 | + $this->conf['root_path'].'/vendor/laravel/lumen-framework/config/', |
|
| 106 | 106 | // App configuration |
| 107 | - $this->conf['root_path'] . '/config/', |
|
| 107 | + $this->conf['root_path'].'/config/', |
|
| 108 | 108 | ]; |
| 109 | 109 | |
| 110 | 110 | $keys = []; |
| 111 | 111 | foreach ($cfgPaths as $cfgPath) { |
| 112 | - $configs = (array)glob($cfgPath . '*.php'); |
|
| 112 | + $configs = (array) glob($cfgPath.'*.php'); |
|
| 113 | 113 | foreach ($configs as $config) { |
| 114 | 114 | $config = substr(basename($config), 0, -4); |
| 115 | 115 | $keys[$config] = $config; |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | public static function autoload($rootPath) |
| 125 | 125 | { |
| 126 | - $autoload = $rootPath . '/bootstrap/autoload.php'; |
|
| 126 | + $autoload = $rootPath.'/bootstrap/autoload.php'; |
|
| 127 | 127 | if (file_exists($autoload)) { |
| 128 | 128 | require_once $autoload; |
| 129 | 129 | } else { |
| 130 | - require_once $rootPath . '/vendor/autoload.php'; |
|
| 130 | + require_once $rootPath.'/vendor/autoload.php'; |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // prefer content in response, secondly ob |
| 159 | - if (!($response instanceof StreamedResponse) && (string)$content === '' && ob_get_length() > 0) { |
|
| 159 | + if (!($response instanceof StreamedResponse) && (string) $content === '' && ob_get_length() > 0) { |
|
| 160 | 160 | $response->setContent(ob_get_contents()); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | $uri = urldecode($uri); |
| 175 | 175 | |
| 176 | - $requestFile = $this->conf['static_path'] . $uri; |
|
| 176 | + $requestFile = $this->conf['static_path'].$uri; |
|
| 177 | 177 | if (is_file($requestFile)) { |
| 178 | 178 | return $this->createStaticResponse($requestFile, $request); |
| 179 | 179 | } |
@@ -189,9 +189,9 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | protected function lookupIndex($folder) |
| 191 | 191 | { |
| 192 | - $folder = rtrim($folder, '/') . '/'; |
|
| 192 | + $folder = rtrim($folder, '/').'/'; |
|
| 193 | 193 | foreach (self::$staticIndexList as $index) { |
| 194 | - $tmpFile = $folder . $index; |
|
| 194 | + $tmpFile = $folder.$index; |
|
| 195 | 195 | if (is_file($tmpFile)) { |
| 196 | 196 | return $tmpFile; |
| 197 | 197 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | public function bindSwoole($swoole) |
| 234 | 234 | { |
| 235 | - $this->currentApp->singleton('swoole', function () use ($swoole) { |
|
| 235 | + $this->currentApp->singleton('swoole', function() use ($swoole) { |
|
| 236 | 236 | return $swoole; |
| 237 | 237 | }); |
| 238 | 238 | } |
@@ -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 = $this->runArtisanCommand(trim('laravels config ' . $passOptionStr)); |
|
| 136 | + $statusCode = $this->runArtisanCommand(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 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,12 +331,12 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | public function getConfig() |
| 333 | 333 | { |
| 334 | - return unserialize((string)file_get_contents($this->getConfPath())); |
|
| 334 | + return unserialize((string) file_get_contents($this->getConfPath())); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | protected function getConfPath() |
| 338 | 338 | { |
| 339 | - return $this->basePath . '/storage/laravels.conf'; |
|
| 339 | + return $this->basePath.'/storage/laravels.conf'; |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | public static function runCommand($cmd, $input = null) |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | public static function kill($pid, $sig) |
| 358 | 358 | { |
| 359 | 359 | try { |
| 360 | - return Process::kill((int)$pid, $sig); |
|
| 360 | + return Process::kill((int) $pid, $sig); |
|
| 361 | 361 | } catch (\Exception $e) { |
| 362 | 362 | return false; |
| 363 | 363 | } |