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