@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | protected function getEurekaUri() |
| 21 | 21 | { |
| 22 | - return $this->host . ':' . $this->port . '/' . $this->context; |
|
| 22 | + return $this->host.':'.$this->port.'/'.$this->context; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function register($appId, array $data) |
| 33 | 33 | { |
| 34 | - return $this->client->request('POST', $this->getEurekaUri() . '/apps/' . $appId, [ |
|
| 34 | + return $this->client->request('POST', $this->getEurekaUri().'/apps/'.$appId, [ |
|
| 35 | 35 | 'json' => [ |
| 36 | 36 | 'instance' => $data, |
| 37 | 37 | ], |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function deRegister($appId, $instanceId) |
| 52 | 52 | { |
| 53 | - return $this->client->request('DELETE', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId); |
|
| 53 | + return $this->client->request('DELETE', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function heartBeat($appId, $instanceId) |
| 67 | 67 | { |
| 68 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId); |
|
| 68 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function getAllApps() |
| 79 | 79 | { |
| 80 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/apps', [ |
|
| 80 | + $response = $this->client->request('GET', $this->getEurekaUri().'/apps', [ |
|
| 81 | 81 | 'headers' => [ |
| 82 | 82 | 'Accept' => 'application/json', |
| 83 | 83 | ], |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function getApp($appId) |
| 99 | 99 | { |
| 100 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/apps/' . $appId, [ |
|
| 100 | + $response = $this->client->request('GET', $this->getEurekaUri().'/apps/'.$appId, [ |
|
| 101 | 101 | 'headers' => [ |
| 102 | 102 | 'Accept' => 'application/json', |
| 103 | 103 | ], |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function getAppInstance($appId, $instanceId) |
| 120 | 120 | { |
| 121 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId, [ |
|
| 121 | + $response = $this->client->request('GET', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId, [ |
|
| 122 | 122 | 'headers' => [ |
| 123 | 123 | 'Accept' => 'application/json', |
| 124 | 124 | ], |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function getInstance($instanceId) |
| 140 | 140 | { |
| 141 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/instances/' . $instanceId, [ |
|
| 141 | + $response = $this->client->request('GET', $this->getEurekaUri().'/instances/'.$instanceId, [ |
|
| 142 | 142 | 'headers' => [ |
| 143 | 143 | 'Accept' => 'application/json', |
| 144 | 144 | ], |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function takeInstanceOut($appId, $instanceId) |
| 159 | 159 | { |
| 160 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
| 160 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
| 161 | 161 | 'query' => [ |
| 162 | 162 | 'value' => 'OUT_OF_SERVICE', |
| 163 | 163 | ], |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function putInstanceBack($appId, $instanceId) |
| 178 | 178 | { |
| 179 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
| 179 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
| 180 | 180 | 'query' => [ |
| 181 | 181 | 'value' => 'UP', |
| 182 | 182 | ], |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function updateAppInstanceMetadata($appId, $instanceId, array $metadata) |
| 198 | 198 | { |
| 199 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/metadata', [ |
|
| 199 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/metadata', [ |
|
| 200 | 200 | 'query' => $metadata, |
| 201 | 201 | ]); |
| 202 | 202 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function getInstancesByVipAddress($vipAddress) |
| 211 | 211 | { |
| 212 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/vips/' . $vipAddress, [ |
|
| 212 | + $response = $this->client->request('GET', $this->getEurekaUri().'/vips/'.$vipAddress, [ |
|
| 213 | 213 | 'headers' => [ |
| 214 | 214 | 'Accept' => 'application/json', |
| 215 | 215 | ], |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function getInstancesBySecureVipAddress($secureVipAddress) |
| 227 | 227 | { |
| 228 | - $response = $this->client->request('GET', $this->getEurekaUri() . '/svips/' . $secureVipAddress, [ |
|
| 228 | + $response = $this->client->request('GET', $this->getEurekaUri().'/svips/'.$secureVipAddress, [ |
|
| 229 | 229 | 'headers' => [ |
| 230 | 230 | 'Accept' => 'application/json', |
| 231 | 231 | ], |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | public function up(string $appId, string $instanceId) |
| 238 | 238 | { |
| 239 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
| 239 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
| 240 | 240 | 'query' => [ |
| 241 | 241 | 'value' => 'UP', |
| 242 | 242 | ], |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | public function down($appId, $instanceId) |
| 247 | 247 | { |
| 248 | - return $this->client->request('PUT', $this->getEurekaUri() . '/apps/' . $appId . '/' . $instanceId . '/status', [ |
|
| 248 | + return $this->client->request('PUT', $this->getEurekaUri().'/apps/'.$appId.'/'.$instanceId.'/status', [ |
|
| 249 | 249 | 'query' => [ |
| 250 | 250 | 'value' => 'DOWN', |
| 251 | 251 | ], |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | public function getUpInstances($appId) |
| 262 | 262 | { |
| 263 | 263 | $apps = $this->getApp($appId); |
| 264 | - return array_filter($apps['application']['instance'], function ($instance) { |
|
| 264 | + return array_filter($apps['application']['instance'], function($instance) { |
|
| 265 | 265 | return $instance['status'] === 'UP'; |
| 266 | 266 | }); |
| 267 | 267 | } |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | } else { |
| 281 | 281 | $parts = parse_url($instance['homePageUrl']); |
| 282 | 282 | if (!isset($parts['host'])) { |
| 283 | - throw new \RuntimeException('Invalid homePageUrl: ' . $instance['homePageUrl']); |
|
| 283 | + throw new \RuntimeException('Invalid homePageUrl: '.$instance['homePageUrl']); |
|
| 284 | 284 | } |
| 285 | 285 | $url = sprintf('%s://%s:%d', isset($parts['scheme']) ? $parts['scheme'] : 'http', $parts['host'], isset($parts['port']) ? $parts['port'] : 80); |
| 286 | 286 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $server[$headerServerMapping[$key]] = $value; |
| 52 | 52 | } else { |
| 53 | 53 | $key = str_replace('-', '_', $key); |
| 54 | - $server['http_' . $key] = $value; |
|
| 54 | + $server['http_'.$key] = $value; |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | $server = array_change_key_case($server, CASE_UPPER); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | && isset($_SERVER['QUERY_STRING']) |
| 66 | 66 | && $_SERVER['QUERY_STRING'] !== '' |
| 67 | 67 | ) { |
| 68 | - $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 68 | + $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // Fix argv & argc |
@@ -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 | } |