campru / guzzle-bundle
Provide Silex web profiler for Guzzle
Installs: 1 914
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 2
Type:silex-bundle
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~5.0
- silex/silex: ~1.2
- silex/web-profiler: ~1.0
Requires (Dev)
- phpmd/phpmd: ~2.2
- phpunit/phpunit: >=3.7.0
- squizlabs/php_codesniffer: ~2.3
This package is auto-updated.
Last update: 2024-11-22 00:22:34 UTC
README
Provide an advanced profiler for Guzzle. This profiler is for debug purposes and will display a dedicated report available in the toolbar and Silex Web Profiler
Installation
Add the composer requirements
{ "require": { "campru/guzzle-bundle": "1.0.0" }, }
Enable it in your application
use Campru\GuzzleBundle\Provider\GuzzleProfilerServiceProvider; $app->register(new GuzzleProfilerServiceProvider());
The provider depends on WebProfilerServiceProvider
, so you also need to enable this if that's not already the case
use Silex\Provider\WebProfilerServiceProvider; $app->register(new Provider\WebProfilerServiceProvider())
Finally, it's needed to add two subscribers to Guzzle client when this is created
use GuzzleHttp\Client; $client = new Client(['base_url' => 'http://my.api.com']); $client->getEmitter()->attach($app['guzzle_bundle.subscriber.profiler']); $client->getEmitter()->attach($app['guzzle_bundle.subscriber.storage']);
Licence
This bundle is under the MIT license. See the complete license in the bundle