| @@ 120-149 (lines=30) @@ | ||
| 117 | ); |
|
| 118 | } |
|
| 119 | ||
| 120 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 121 | { |
|
| 122 | $response = $this->service->run( |
|
| 123 | new Request( |
|
| 124 | [ |
|
| 125 | 'SERVER_PORT' => 80, |
|
| 126 | 'SERVER_NAME' => 'vpn.example', |
|
| 127 | 'REQUEST_METHOD' => $requestMethod, |
|
| 128 | 'SCRIPT_NAME' => '/index.php', |
|
| 129 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 130 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 131 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 132 | ], |
|
| 133 | $getData, |
|
| 134 | $postData |
|
| 135 | ) |
|
| 136 | ); |
|
| 137 | ||
| 138 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 139 | if ($responseArray['ok']) { |
|
| 140 | if (array_key_exists('data', $responseArray)) { |
|
| 141 | return $responseArray['data']; |
|
| 142 | } |
|
| 143 | ||
| 144 | return true; |
|
| 145 | } |
|
| 146 | ||
| 147 | // in case of errors... |
|
| 148 | return $responseArray; |
|
| 149 | } |
|
| 150 | } |
|
| 151 | ||
| @@ 174-203 (lines=30) @@ | ||
| 171 | ); |
|
| 172 | } |
|
| 173 | ||
| 174 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 175 | { |
|
| 176 | $response = $this->service->run( |
|
| 177 | new Request( |
|
| 178 | [ |
|
| 179 | 'SERVER_PORT' => 80, |
|
| 180 | 'SERVER_NAME' => 'vpn.example', |
|
| 181 | 'REQUEST_METHOD' => $requestMethod, |
|
| 182 | 'SCRIPT_NAME' => '/index.php', |
|
| 183 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 184 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 185 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 186 | ], |
|
| 187 | $getData, |
|
| 188 | $postData |
|
| 189 | ) |
|
| 190 | ); |
|
| 191 | ||
| 192 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 193 | if ($responseArray['ok']) { |
|
| 194 | if (array_key_exists('data', $responseArray)) { |
|
| 195 | return $responseArray['data']; |
|
| 196 | } |
|
| 197 | ||
| 198 | return true; |
|
| 199 | } |
|
| 200 | ||
| 201 | // in case of errors... |
|
| 202 | return $responseArray; |
|
| 203 | } |
|
| 204 | } |
|
| 205 | ||
| @@ 87-116 (lines=30) @@ | ||
| 84 | ); |
|
| 85 | } |
|
| 86 | ||
| 87 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 88 | { |
|
| 89 | $response = $this->service->run( |
|
| 90 | new Request( |
|
| 91 | [ |
|
| 92 | 'SERVER_PORT' => 80, |
|
| 93 | 'SERVER_NAME' => 'vpn.example', |
|
| 94 | 'REQUEST_METHOD' => $requestMethod, |
|
| 95 | 'SCRIPT_NAME' => '/index.php', |
|
| 96 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 97 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 98 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 99 | ], |
|
| 100 | $getData, |
|
| 101 | $postData |
|
| 102 | ) |
|
| 103 | ); |
|
| 104 | ||
| 105 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 106 | if ($responseArray['ok']) { |
|
| 107 | if (array_key_exists('data', $responseArray)) { |
|
| 108 | return $responseArray['data']; |
|
| 109 | } |
|
| 110 | ||
| 111 | return true; |
|
| 112 | } |
|
| 113 | ||
| 114 | // in case of errors... |
|
| 115 | return $responseArray; |
|
| 116 | } |
|
| 117 | } |
|
| 118 | ||
| @@ 111-140 (lines=30) @@ | ||
| 108 | ); |
|
| 109 | } |
|
| 110 | ||
| 111 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 112 | { |
|
| 113 | $response = $this->service->run( |
|
| 114 | new Request( |
|
| 115 | [ |
|
| 116 | 'SERVER_PORT' => 80, |
|
| 117 | 'SERVER_NAME' => 'vpn.example', |
|
| 118 | 'REQUEST_METHOD' => $requestMethod, |
|
| 119 | 'SCRIPT_NAME' => '/index.php', |
|
| 120 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 121 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 122 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 123 | ], |
|
| 124 | $getData, |
|
| 125 | $postData |
|
| 126 | ) |
|
| 127 | ); |
|
| 128 | ||
| 129 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 130 | if ($responseArray['ok']) { |
|
| 131 | if (array_key_exists('data', $responseArray)) { |
|
| 132 | return $responseArray['data']; |
|
| 133 | } |
|
| 134 | ||
| 135 | return true; |
|
| 136 | } |
|
| 137 | ||
| 138 | // in case of errors... |
|
| 139 | return $responseArray; |
|
| 140 | } |
|
| 141 | } |
|
| 142 | ||
| @@ 122-151 (lines=30) @@ | ||
| 119 | ); |
|
| 120 | } |
|
| 121 | ||
| 122 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 123 | { |
|
| 124 | $response = $this->service->run( |
|
| 125 | new Request( |
|
| 126 | [ |
|
| 127 | 'SERVER_PORT' => 80, |
|
| 128 | 'SERVER_NAME' => 'vpn.example', |
|
| 129 | 'REQUEST_METHOD' => $requestMethod, |
|
| 130 | 'SCRIPT_NAME' => '/index.php', |
|
| 131 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 132 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 133 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 134 | ], |
|
| 135 | $getData, |
|
| 136 | $postData |
|
| 137 | ) |
|
| 138 | ); |
|
| 139 | ||
| 140 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 141 | if ($responseArray['ok']) { |
|
| 142 | if (array_key_exists('data', $responseArray)) { |
|
| 143 | return $responseArray['data']; |
|
| 144 | } |
|
| 145 | ||
| 146 | return true; |
|
| 147 | } |
|
| 148 | ||
| 149 | // in case of errors... |
|
| 150 | return $responseArray; |
|
| 151 | } |
|
| 152 | } |
|
| 153 | ||
| @@ 357-386 (lines=30) @@ | ||
| 354 | ); |
|
| 355 | } |
|
| 356 | ||
| 357 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 358 | { |
|
| 359 | $response = $this->service->run( |
|
| 360 | new Request( |
|
| 361 | [ |
|
| 362 | 'SERVER_PORT' => 80, |
|
| 363 | 'SERVER_NAME' => 'vpn.example', |
|
| 364 | 'REQUEST_METHOD' => $requestMethod, |
|
| 365 | 'SCRIPT_NAME' => '/index.php', |
|
| 366 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 367 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 368 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 369 | ], |
|
| 370 | $getData, |
|
| 371 | $postData |
|
| 372 | ) |
|
| 373 | ); |
|
| 374 | ||
| 375 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 376 | if ($responseArray['ok']) { |
|
| 377 | if (array_key_exists('data', $responseArray)) { |
|
| 378 | return $responseArray['data']; |
|
| 379 | } |
|
| 380 | ||
| 381 | return true; |
|
| 382 | } |
|
| 383 | ||
| 384 | // in case of errors... |
|
| 385 | return $responseArray; |
|
| 386 | } |
|
| 387 | } |
|
| 388 | ||