Closed gimler closed 12 years ago
I got your version of the bundle working with the latest version of guzzle, and its working great. The only thing i
m missing is the logger in the Symfony profiler. It shows no requests in the profiler, even though i`m making several requests.
Could you show how to enable to logging for the guzzle bundle?
Did you see the Point Guzzle in the debug toolbar? Do you use the service "guzzle.service_builder" to build your clients?
I`m not seeing guzzle in the toolbar. I am seeing guzzle in the profiler page, which is showing 'No requests sent'.
Im not using the guzzle.service.builder to build my clients, i
m using a custom client that initializes the guzzle client.
Thats the problem you must use the service or see service.xml file attach the plugins manually. When you use the service it attach the plugins automatically.
Could you show what could would be required to enable the dataCollector?
Something like this is not working yet: $this->apiClient = new Client($apiLocation); $dataCollector = new DataCollectorPlugin(); $this->apiClient->addSubscriber($dataCollector);
Error given: Call to undefined method Guzzle\Http\Message\EntityEnclosingRequest::getResourceUri(). Line 92 in the dataCollectorPlugin.
you forgot to add the Guzzle\Common\Log\ArrayLogAdapter to the dataCollectorPlugin try
$dataCollector = new DataCollectorPlugin(new Guzzle\Common\Log\ArrayLogAdapter());
$this->apiClient->addSubscriber($dataCollector);
When I do that the error from my message above still appears. When commenting that line the site is working, but i`m not seeing any requests in the profiler?
The plugin does seem to be called and the requests go through the plugin.
ahh yes sorry you must use the service "guzzle.plugin.log.array.adapter" so this is use in the collector
$logAdapter = $this->container->get('guzzle.plugin.log.array.adapter');
$this->apiClient->addSubscriber($logAdapter);
When i add that line my session gets killed and the setLocale function for the session stops working :/. (session = null) Any clue?
Check if logging is enabled. When i find some time i can add a example for this.
@gimler I made a breaking change a few versions ago that renamed getResourceUri() to getResource(). This might be part of the problem.
+1 Waiting for merge
+1
I'm definitely in favour of getting the rewrite merged, but it's not working for me and I'm not sure how it's working for others.
When retrieving the service builder, I get the following:
Catchable Fatal Error: Argument 2 passed to Guzzle\Service\Builder\ServiceBuilder::factory() must be an array, object given in /Users/lachlan/Development/BTNv2/vendor/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilder.php line 45
I've checked various versions of Guzzle itself and in all recent versions this is the case.
Sidenote: I've added a composer.json in my own fork, will add that in once I figure this out
i have checked this and it works with the latest guzzle version c8b3c4c3d07c3469dd7bfc758e1e631a723e3bb7
i think you use the deprecated cache configuration please use the guzzle client cache not this provided by the bundle. There is a PR for remove the old cache logic https://github.com/ddeboer/GuzzleBundle/pull/2
Thanks @gimler - that was indeed the case. I was working on a simple checkout of your branch - it's gotten a bit messy around here with the various pull requests.
https://github.com/ddeboer/GuzzleBundle/issues/8 vote for this please ;)
Upgrade bundle to be compatible with the latest guzzle version.
Better integration and support for symfony log ;)
fix #5 #6