|
@@ 309-318 (lines=10) @@
|
| 306 |
|
return $this->setLogger($log, $format); |
| 307 |
|
} |
| 308 |
|
|
| 309 |
|
public static function createInstance($section = 'default', $path = null, array $config = []) |
| 310 |
|
{ |
| 311 |
|
$auth = \Akamai\Open\EdgeGrid\Authentication::createInstance($section, $path); |
| 312 |
|
|
| 313 |
|
if ($host = $auth->getHost()) { |
| 314 |
|
$config['base_uri'] = 'https://' .$host; |
| 315 |
|
} |
| 316 |
|
|
| 317 |
|
return new static($config, $auth); |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
public static function createFromEnv($section = 'default', array $config = []) |
| 321 |
|
{ |
|
@@ 320-329 (lines=10) @@
|
| 317 |
|
return new static($config, $auth); |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
public static function createFromEnv($section = 'default', array $config = []) |
| 321 |
|
{ |
| 322 |
|
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEnv($section); |
| 323 |
|
|
| 324 |
|
if ($host = $auth->getHost()) { |
| 325 |
|
$config['base_uri'] = 'https://' . $host; |
| 326 |
|
} |
| 327 |
|
|
| 328 |
|
return new static($config, $auth); |
| 329 |
|
} |
| 330 |
|
|
| 331 |
|
/** |
| 332 |
|
* Factory method to create a client using credentials from `.edgerc` |
|
@@ 342-351 (lines=10) @@
|
| 339 |
|
* @param array $config Options to pass to the constructor/guzzle |
| 340 |
|
* @return \Akamai\Open\EdgeGrid\Client |
| 341 |
|
*/ |
| 342 |
|
public static function createFromEdgeRcFile($section = 'default', $path = null, array $config = []) |
| 343 |
|
{ |
| 344 |
|
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile($section, $path); |
| 345 |
|
|
| 346 |
|
if ($host = $auth->getHost()) { |
| 347 |
|
$config['base_uri'] = 'https://' . $host; |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
return new static($config, $auth); |
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
/** |
| 354 |
|
* Print HTTP requests/responses to STDOUT |