| @@ 182-211 (lines=30) @@ | ||
| 179 | ); |
|
| 180 | } |
|
| 181 | ||
| 182 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 183 | { |
|
| 184 | $response = $this->service->run( |
|
| 185 | new Request( |
|
| 186 | [ |
|
| 187 | 'SERVER_PORT' => 80, |
|
| 188 | 'SERVER_NAME' => 'vpn.example', |
|
| 189 | 'REQUEST_METHOD' => $requestMethod, |
|
| 190 | 'SCRIPT_NAME' => '/index.php', |
|
| 191 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 192 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 193 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 194 | ], |
|
| 195 | $getData, |
|
| 196 | $postData |
|
| 197 | ) |
|
| 198 | ); |
|
| 199 | ||
| 200 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 201 | if ($responseArray['ok']) { |
|
| 202 | if (array_key_exists('data', $responseArray)) { |
|
| 203 | return $responseArray['data']; |
|
| 204 | } |
|
| 205 | ||
| 206 | return true; |
|
| 207 | } |
|
| 208 | ||
| 209 | // in case of errors... |
|
| 210 | return $responseArray; |
|
| 211 | } |
|
| 212 | } |
|
| 213 | ||
| @@ 92-121 (lines=30) @@ | ||
| 89 | ); |
|
| 90 | } |
|
| 91 | ||
| 92 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 93 | { |
|
| 94 | $response = $this->service->run( |
|
| 95 | new Request( |
|
| 96 | [ |
|
| 97 | 'SERVER_PORT' => 80, |
|
| 98 | 'SERVER_NAME' => 'vpn.example', |
|
| 99 | 'REQUEST_METHOD' => $requestMethod, |
|
| 100 | 'SCRIPT_NAME' => '/index.php', |
|
| 101 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 102 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 103 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 104 | ], |
|
| 105 | $getData, |
|
| 106 | $postData |
|
| 107 | ) |
|
| 108 | ); |
|
| 109 | ||
| 110 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 111 | if ($responseArray['ok']) { |
|
| 112 | if (array_key_exists('data', $responseArray)) { |
|
| 113 | return $responseArray['data']; |
|
| 114 | } |
|
| 115 | ||
| 116 | return true; |
|
| 117 | } |
|
| 118 | ||
| 119 | // in case of errors... |
|
| 120 | return $responseArray; |
|
| 121 | } |
|
| 122 | } |
|
| 123 | ||
| @@ 130-159 (lines=30) @@ | ||
| 127 | ); |
|
| 128 | } |
|
| 129 | ||
| 130 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 131 | { |
|
| 132 | $response = $this->service->run( |
|
| 133 | new Request( |
|
| 134 | [ |
|
| 135 | 'SERVER_PORT' => 80, |
|
| 136 | 'SERVER_NAME' => 'vpn.example', |
|
| 137 | 'REQUEST_METHOD' => $requestMethod, |
|
| 138 | 'SCRIPT_NAME' => '/index.php', |
|
| 139 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 140 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 141 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 142 | ], |
|
| 143 | $getData, |
|
| 144 | $postData |
|
| 145 | ) |
|
| 146 | ); |
|
| 147 | ||
| 148 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 149 | if ($responseArray['ok']) { |
|
| 150 | if (array_key_exists('data', $responseArray)) { |
|
| 151 | return $responseArray['data']; |
|
| 152 | } |
|
| 153 | ||
| 154 | return true; |
|
| 155 | } |
|
| 156 | ||
| 157 | // in case of errors... |
|
| 158 | return $responseArray; |
|
| 159 | } |
|
| 160 | } |
|
| 161 | ||
| @@ 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 | ||
| @@ 130-159 (lines=30) @@ | ||
| 127 | ); |
|
| 128 | } |
|
| 129 | ||
| 130 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 131 | { |
|
| 132 | $response = $this->service->run( |
|
| 133 | new Request( |
|
| 134 | [ |
|
| 135 | 'SERVER_PORT' => 80, |
|
| 136 | 'SERVER_NAME' => 'vpn.example', |
|
| 137 | 'REQUEST_METHOD' => $requestMethod, |
|
| 138 | 'SCRIPT_NAME' => '/index.php', |
|
| 139 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 140 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 141 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 142 | ], |
|
| 143 | $getData, |
|
| 144 | $postData |
|
| 145 | ) |
|
| 146 | ); |
|
| 147 | ||
| 148 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 149 | if ($responseArray['ok']) { |
|
| 150 | if (array_key_exists('data', $responseArray)) { |
|
| 151 | return $responseArray['data']; |
|
| 152 | } |
|
| 153 | ||
| 154 | return true; |
|
| 155 | } |
|
| 156 | ||
| 157 | // in case of errors... |
|
| 158 | return $responseArray; |
|
| 159 | } |
|
| 160 | } |
|
| 161 | ||
| @@ 340-369 (lines=30) @@ | ||
| 337 | ); |
|
| 338 | } |
|
| 339 | ||
| 340 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 341 | { |
|
| 342 | $response = $this->service->run( |
|
| 343 | new Request( |
|
| 344 | [ |
|
| 345 | 'SERVER_PORT' => 80, |
|
| 346 | 'SERVER_NAME' => 'vpn.example', |
|
| 347 | 'REQUEST_METHOD' => $requestMethod, |
|
| 348 | 'SCRIPT_NAME' => '/index.php', |
|
| 349 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 350 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 351 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 352 | ], |
|
| 353 | $getData, |
|
| 354 | $postData |
|
| 355 | ) |
|
| 356 | ); |
|
| 357 | ||
| 358 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 359 | if ($responseArray['ok']) { |
|
| 360 | if (array_key_exists('data', $responseArray)) { |
|
| 361 | return $responseArray['data']; |
|
| 362 | } |
|
| 363 | ||
| 364 | return true; |
|
| 365 | } |
|
| 366 | ||
| 367 | // in case of errors... |
|
| 368 | return $responseArray; |
|
| 369 | } |
|
| 370 | } |
|
| 371 | ||