| @@ 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 | 'PATH_INFO' => sprintf('/%s', $pathInfo), |
|
| 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 | ||
| @@ 94-123 (lines=30) @@ | ||
| 91 | ); |
|
| 92 | } |
|
| 93 | ||
| 94 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 95 | { |
|
| 96 | $response = $this->service->run( |
|
| 97 | new Request( |
|
| 98 | [ |
|
| 99 | 'SERVER_PORT' => 80, |
|
| 100 | 'SERVER_NAME' => 'vpn.example', |
|
| 101 | 'REQUEST_METHOD' => $requestMethod, |
|
| 102 | 'PATH_INFO' => sprintf('/%s', $pathInfo), |
|
| 103 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 104 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 105 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 106 | ], |
|
| 107 | $getData, |
|
| 108 | $postData |
|
| 109 | ) |
|
| 110 | ); |
|
| 111 | ||
| 112 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 113 | if ($responseArray['ok']) { |
|
| 114 | if (array_key_exists('data', $responseArray)) { |
|
| 115 | return $responseArray['data']; |
|
| 116 | } |
|
| 117 | ||
| 118 | return true; |
|
| 119 | } |
|
| 120 | ||
| 121 | // in case of errors... |
|
| 122 | return $responseArray; |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||
| @@ 273-302 (lines=30) @@ | ||
| 270 | ); |
|
| 271 | } |
|
| 272 | ||
| 273 | private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = []) |
|
| 274 | { |
|
| 275 | $response = $this->service->run( |
|
| 276 | new Request( |
|
| 277 | [ |
|
| 278 | 'SERVER_PORT' => 80, |
|
| 279 | 'SERVER_NAME' => 'vpn.example', |
|
| 280 | 'REQUEST_METHOD' => $requestMethod, |
|
| 281 | 'PATH_INFO' => sprintf('/%s', $pathInfo), |
|
| 282 | 'REQUEST_URI' => sprintf('/%s', $pathInfo), |
|
| 283 | 'PHP_AUTH_USER' => $basicAuth[0], |
|
| 284 | 'PHP_AUTH_PW' => $basicAuth[1], |
|
| 285 | ], |
|
| 286 | $getData, |
|
| 287 | $postData |
|
| 288 | ) |
|
| 289 | ); |
|
| 290 | ||
| 291 | $responseArray = json_decode($response->getBody(), true)[$pathInfo]; |
|
| 292 | if ($responseArray['ok']) { |
|
| 293 | if (array_key_exists('data', $responseArray)) { |
|
| 294 | return $responseArray['data']; |
|
| 295 | } |
|
| 296 | ||
| 297 | return true; |
|
| 298 | } |
|
| 299 | ||
| 300 | // in case of errors... |
|
| 301 | return $responseArray; |
|
| 302 | } |
|
| 303 | } |
|
| 304 | ||
| @@ 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 | 'PATH_INFO' => sprintf('/%s', $pathInfo), |
|
| 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 | ||
| @@ 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 | 'PATH_INFO' => sprintf('/%s', $pathInfo), |
|
| 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 | ||