Guzzle4 Subscriber (plugin) interface

44 views
Skip to first unread message

David Jellesma

unread,
Apr 8, 2014, 11:40:01 AM4/8/14
to guz...@googlegroups.com
I had written a basic plugin for Guzzle3 to handle OAuth2 authorization, which made the parameters 'api_key' and 'access_token' only required when executing the command if they were NOT supplied when instantiating the client. Meaning the following 2 examples were both valid:

1.
$client = new MyClient(['apikey'] => 'someapikeyvalue']);

2. 
$client = new MyClient;
$client->someCommand(['apikey'] => 'someapikeyvalue']);

Im running into an issue with Guzzle4 where I am having trouble locating the parameters passed in with the command. 

I can see them very deeply nested when performing:

$client->getEmitter()->on('before', function (BeforeEvent $e) use ($config) {
    print_r($e->getRequest()->getEmitter()->listeners()['error'][0]);
)

but I can't imagine that this is the intended way to look at the parameters provided with the request. Has anyone run into this? Am I coming at this from the wrong direction?
Reply all
Reply to author
Forward
0 new messages