|
@@ 317-326 (lines=10) @@
|
| 314 |
|
* @return Client |
| 315 |
|
* @throws \Akamai\Open\EdgeGrid\Authentication\Exception\ConfigException |
| 316 |
|
*/ |
| 317 |
|
public static function createInstance($section = 'default', $path = null, array $config = []) |
| 318 |
|
{ |
| 319 |
|
$auth = \Akamai\Open\EdgeGrid\Authentication::createInstance($section, $path); |
| 320 |
|
|
| 321 |
|
if ($host = $auth->getHost()) { |
| 322 |
|
$config['base_uri'] = 'https://' .$host; |
| 323 |
|
} |
| 324 |
|
|
| 325 |
|
return new static($config, $auth); |
| 326 |
|
} |
| 327 |
|
|
| 328 |
|
public static function createFromEnv($section = 'default', array $config = []) |
| 329 |
|
{ |
|
@@ 328-337 (lines=10) @@
|
| 325 |
|
return new static($config, $auth); |
| 326 |
|
} |
| 327 |
|
|
| 328 |
|
public static function createFromEnv($section = 'default', array $config = []) |
| 329 |
|
{ |
| 330 |
|
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEnv($section); |
| 331 |
|
|
| 332 |
|
if ($host = $auth->getHost()) { |
| 333 |
|
$config['base_uri'] = 'https://' . $host; |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
return new static($config, $auth); |
| 337 |
|
} |
| 338 |
|
|
| 339 |
|
/** |
| 340 |
|
* Factory method to create a client using credentials from `.edgerc` |
|
@@ 350-359 (lines=10) @@
|
| 347 |
|
* @param array $config Options to pass to the constructor/guzzle |
| 348 |
|
* @return \Akamai\Open\EdgeGrid\Client |
| 349 |
|
*/ |
| 350 |
|
public static function createFromEdgeRcFile($section = 'default', $path = null, array $config = []) |
| 351 |
|
{ |
| 352 |
|
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile($section, $path); |
| 353 |
|
|
| 354 |
|
if ($host = $auth->getHost()) { |
| 355 |
|
$config['base_uri'] = 'https://' . $host; |
| 356 |
|
} |
| 357 |
|
|
| 358 |
|
return new static($config, $auth); |
| 359 |
|
} |
| 360 |
|
|
| 361 |
|
/** |
| 362 |
|
* Print HTTP requests/responses to STDOUT |