https://github.com/ludofleury/buzzbundle
Debug your API Calls with a Symfony web profiler for Buzz
https://github.com/ludofleury/buzzbundle
Last synced: 7 months ago
JSON representation
Debug your API Calls with a Symfony web profiler for Buzz
- Host: GitHub
- URL: https://github.com/ludofleury/buzzbundle
- Owner: ludofleury
- License: mit
- Created: 2012-12-20T02:37:38.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-20T05:13:17.000Z (almost 13 years ago)
- Last Synced: 2025-01-23T03:28:18.265Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 347 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Playbloom Buzz Bundle
Provide a basic logger and an advanced profiler for Buzz
This work is a quick port of the [Playbloom GuzzleBundle](https://github.com/ludofleury/GuzzleBundle).
It may be improved with some features from the GuzzleBundle, yet I do not provide support, feel free to fork & PR.* The basic logger use the default Symfony app logger, it's safe to use in your production environement.
* The advanced profiler is for debug purposes and will display a dedicated report available in the toolbar and in the Symfony Web Profiler
![]()
![]()
## Installation
Add the composer requirements (will be soon on packagist)
```javascript
{
"require-dev": {
"playbloom/buzz-bundle": "dev-master"
},"repositories": [
{
"type": "git",
"url": "git://github.com/ludofleury/BuzzBundle.git"
}
]
}
```Add the bundle to your Symfony app kernel
```php```
To enable the advanced profiler & the toolbar/web profiler panel, add this line to your `app/config/config_dev.yml`
```yml
playbloom_buzz:
web_profiler: true
```### Buzz client as a Symfony service
Buzz is a lightweight browser so the service declaration is straightforward. Just add the tag `playbloom_buzz.browser` and it will add the basic logger to your client(s). If the web_profiler is enabled in the current environement, it will also add the advanced profiler and display report on the Symfony toolbar/web profiler.
```xml
```
### Add the logger/profiler manually to a Buzz browser
To register the logger or profiler listener manually for a browser, you can retrieve theses services from the Symfony container.
```php
get('playbloom_buzz.browser.listener.logger');
$browser->addListener($loggerListener);// advanced profiler for developement and debug, requires web_profiler to be enabled
$profilerListener = $container->get('playbloom_buzz.browser.listener.profiler');
$client->addListener($profilerListener);?>
```## Limitations
* It doesn't handle the logging/profiling for a Buzz Client, you need to use a Buzz browser (buzz implementation limitation).
* The Message (request/response) from Buzz are really simple and so the informations in the profiler.
* If you need a rock-solid HTTP client, try [Guzzle](http://guzzlephp.org/) and... the [Playbloom GuzzleBundle](https://github.com/ludofleury/GuzzleBundle) !## Licence
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
## Credits
* Swagger for the UI