Releases: akamai/AkamaiOPEN-edgegrid-php-client
Update Dependencies
0.4.6 Fix phar for 0.4.6
PHP 5.3+ Compatibility
This release has some minor changes to allow running the signer on PHP 5.3+.
Note: This is probably the last pre-release version before 1.0
Use STDERR stream instead of cli-only constant (Fixes #24)
0.4.4 Update docs for 0.4.4
Update Default Timeout
This release changes the default timeout to 300 seconds to match the SLA (Refs #20)
Bugfix
CLI Improvements
Add more httpie-compatible features
- Support for
--follow
(redirects are no longer followed by default) - Support
--json|-j
(default: on) - Support sending data as form data using
--form|-f
- Support for
STDIN
input - Support for using file contents as values for JSON and Form inputs (but not sending files themselves) using
=@
and:=@
URL
andMETHOD
can now be anywhere in the argument string- Now supports
example.org[/path]
type URLs - Add
--version
- Better handling of no-argument invocation
PSR-7 support, CLI interface
- Add support for PSR-7 requests (e.g.
->send()
and->sendAsync()
) (See #14) - Add CLI interface to PHAR release file (See #8, docs)
- Move away from using
\Exception
to more appropriate, and package specific exceptions (See #13) - Use a custom User-Agent (See #10)
- Fix issue with string query args (See #12)
- Show request body when using the verbose handler (See #11)
Refactor to using Guzzle Middleware
This release adds a new \Akamai\Open\EdgeGrid\Handler\Authentication
class which is a Guzzle Middleware Handler.
For more details on Guzzle middleware see this link.
To use, simply do the following:
$auth = \Akamai\Open\EdgeGrid\Handler\Authentication::createFromEdgeRcFile();
// or:
$auth = new \Akamai\Open\EdgeGrid\Handler\Authentication;
$auth->setAuth($client_token, $client_secret, $access_token);
// Create the handler stack
$handlerStack = HandlerStack::create();
// Add the Auth handler to the stack
$handlerStack->push($auth);
// Add the handler to a regular \GuzzleHttp\Client
$guzzle = new \GuzzleHttp\Client([
"handler" => $handlerStack
]);
// All requests to Akamai {OPEN} EdgeGrid are now automatically signed
Additionally, it adds a \Akamai\Open\EdgeGrid\Handler\Verbose
handler, which enables you to output/log responses (defaults to outputting non-errors to STDOUT
and errors to STDERR
).
You can use this by adding it to the handler stack:
// Create the handler stack
$handlerStack = HandlerStack::create();
// Add the Auth handler to the stack
$handlerStack->push(new \Akamai\Open\EdgeGrid\Handler\Verbose());
// Add the handler to a regular \GuzzleHttp\Client
$guzzle = new \GuzzleHttp\Client([
"handler" => $handlerStack
]);
// Response bodies are now output
It also adds a \Akamai\Open\EdgeGrid\Handler\Debug
handler which will output/log error responses (defaults to STDERR
):
// Create the handler stack
$handlerStack = HandlerStack::create();
// Add the Auth handler to the stack
$handlerStack->push(new \Akamai\Open\EdgeGrid\Handler\Debug());
// Add the handler to a regular \GuzzleHttp\Client
$guzzle = new \GuzzleHttp\Client([
"handler" => $handlerStack
]);
// Response bodies are now output
Add PSR-3 Logging
This release adds PSR-3 compatible logging, defaulting to monolog/monolog
Also:
- Fixes some minor bugs
- Adds
\Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile()
Refactor Authentication out of the Client for better re-use
This release is 100% backwards compatible with 0.1.0!