Comments (2)
Hi @cam8001,
This is great to see! I'd love to see better integration with Drupal 8 and will do what I can help you with that! :)
This issue seems very odd, as you can see on Line 446, there is a catch (\InvalidArgumentException)
which should catch this exact exception.
What's happening is that the authentication handler needs to be added to the handler stack before the history handler if it has been added. Unfortunately, Guzzle provides no way to check if something is in the stack, so we attempt to add it before (Line 445), and if that fails this exception is thrown — we then just add it to the end of the stack (Line 448).
So yes, the exception is expected in some scenarios, and should be handled…
If I create a test case that replicates the pertinent bits of your code, as below, it passes just fine:
// Test class
class ClientExtended extends Client {
public static function create($client_token, $client_secret, $access_token)
{
$config = ['timeout' => 5];
$instance = new static($config);
$instance->setAuth($client_token, $client_secret, $access_token);
return $instance;
}
}
// test case
public function testIssue19ExtendStaticInstantiate()
{
$access_token = "akab-access-token-xxx-xxxxxxxxxxxxxxxx";
$client_token = "akab-client-token-xxx-xxxxxxxxxxxxxxxx";
$client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=";
$instance = ClientExtended::create($client_token, $client_secret, $access_token);
$this->assertInstanceOf(ClientExtended::class, $instance);
}
Can you confirm that you are using 0.4.2? Are you installing via Composer, or using the PHAR?
from akamaiopen-edgegrid-php-client.
Thanks for the excellent response!
As it turns out I had an over-enthusiastic XDebug config that was notified me about every Exception whether it was caught or not (xdebug.show_exception_trace=1
).
Great to open the lines of communication though - I'm sure I'll call on you again ;).
from akamaiopen-edgegrid-php-client.
Related Issues (20)
- Please change default timeout HOT 1
- Add to https://developer.akamai.com/introduction/Open_Source.html HOT 2
- Change SSL Curl options HOT 5
- Minor bug in the readme file.
- Notice: Use of undefined constant STDERR - assumed 'STDERR' in Akamai\Open\EdgeGrid\Client->getDebugOption() (line 356 of vendor/akamai-open/edgegrid-client/src/Client.php). HOT 2
- Bin script rename? HOT 5
- Wrong URl HOT 1
- PHP 5.3+ is supposed to be compatible, dependencies still require 5.5+ HOT 5
- Inquiry - support of TLS 1.2 HOT 1
- Compatibility with monolog/monolog 2.x HOT 6
- Compatibility with guzzlehttp/guzzle 7.X HOT 1
- Will this Library receive any Update again? HOT 2
- PHP 8+ support? HOT 1
- The "GuzzleHttp\Client" class is considered final. It may change without further notice as of its next major version. You should not extend it from "Akamai\Open\EdgeGrid\Client". HOT 1
- PHP 8.2 support? HOT 1
- I wish the composer package supported psr/log 3.0 or higher HOT 1
- Release 0.3.0
- [PLAN] Release 0.4.0
- String query args in the URL/path fail to produce a valid authorization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akamaiopen-edgegrid-php-client.