slepic / psr-http-message-tracy-panel
A panel for Tracy, that traces PSR HTTP messages travelling between your PHP backend and other HTTP servers.
Installs: 17 073
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 0
Open Issues: 3
Language:HTML
Requires
- php: >=5.6
- slepic/http-transfer: ^0.1 || ^1.0
- slepic/templated-tracy-bar-panel: ^0.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- phpunit/phpunit: ~5.0
- slepic/guzzle-http-observing-middleware: ^0.1.1
Suggests
- slepic/http-transfer-observer-consumer: See existing observer consumers for possible adapters for your favourite http client.
Provides
README
psr-http-message-tracy-panel
A panel for Tracy, that traces PSR HTTP messages travelling between your PHP backend and other HTTP servers.
Requirements
PHP ^5.6 or ^7.0
Installation
Install with composer:
composer require --dev slepic/psr-http-message-tracy-panel
Usage
Basicaly you just need to:
-
create the bar panel using the factory
Slepic\Tracy\Bar\PsrHttpMessagePanel\Factory
and register it withTracy\Debugger::getBar()->addPanel()
. -
to create the panel instance you will need to feed it with an iterator of instances of
Slepic\Http\Transfer\Log\LogInterface
. -
simple implementation of such iterator is included in the
slepic/http-transfer
package and is namedSlepic\Psr\Http\Transfer\Log\ArrayStorage
, which simply stores transfer log in a PHP array. -
And lastly, you need to feed the storage with the transfer logs using your http client.
- The
slepic/http-transfer
package providesHistoryObserver
class which allows to easily collect the logs into your storage using your favourite http client. - Check
slepic/http-transfer-observer-consumer
for a list of adapters to see if there is one for your http client.
- The
For complete usage exaple see this example!
And of course it is super simple to register the panel in Nette's DI as described here.
Changelog
0.3.1
- Improved readme
- Removed dependency on tracy as it is dependent indirectly (through slepic/teplated-tracy-bar-panel).
- Fixed dependecies to a versioned revision instead of just latest commit to master.
- Changed travis setup to only run tests in oldest and newest php versions supported by this package (that is 5.6 and 7.3).
0.3.0
- Removed class PsrHttpMessagePanel
- Factory is now used to create the panel, using TemplatedBarPanel class from
slepic/templated-tracy-bar-panel
package as the target implementation. - Slepic\Psr namespace is now replaced by package
slepic/http-transfer
- support for guzzle moved to
slepic/guzzle-http-observing-middleware
- BC break: totally everythig
0.2.0
- Added support for transfer duration
- Improved panel layout