2017 © Pedro Peláez
 

library guzzle-clockwork

A Guzzle middleware that logs requests with Clockwork

image

hannesvdvreken/guzzle-clockwork

A Guzzle middleware that logs requests with Clockwork

  • Tuesday, February 20, 2018
  • by hannesvdvreken
  • Repository
  • 2 Watchers
  • 25 Stars
  • 21,537 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 12 Versions
  • 3 % Grown

The README.md

Guzzle middleware for Clockwork logging

⚠️ This project is up for adoption. Get in touch if you're interested in actively maintaining 3 closely related packages., (*1)

Build Status Latest Stable Version Code Quality Code Coverage Total Downloads License, (*2)

Guzzle middleware for logging requests clockwork's timeline so you can view the timeline in your browser's developer tools., (*3)

Developer tools timeline, (*4)

Developer tools logs, (*5)

Usage

// First you need a Clockwork object
$clockwork = \Clockwork\Support\Vanilla\Clockwork::init();

// Create the Guzzle middleware
$middleware = new \GuzzleHttp\Profiling\Middleware(
    new \GuzzleHttp\Profiling\Clockwork\Profiler($clockwork->getClockwork()->timeline())
);

// Then you need to add it to the Guzzle HandlerStack
$stack = \GuzzleHttp\HandlerStack::create();

$stack->unshift($middleware);

$client = new \GuzzleHttp\Client(['handler' => $stack]);

$client->get('https://httpbin.org/status/418');

Depending on your integration of Clockwork, make sure that you call $clockwork->requestProcessed(); before you output your page., (*6)

Laravel

If you are using Laravel, use the included service providers to add the subscriber to every Guzzle Client., (*7)

'providers' => [
    ...
    \Clockwork\Support\Laravel\ClockworkServiceProvider::class,
    \GuzzleHttp\Profiling\Clockwork\Support\Laravel\ServiceProvider::class,
],

Be sure to create every client (type hint with GuzzleHttp\ClientInterface or GuzzleHttp\Client) via the IoC container., (*8)

Guzzle v4 and v5

Versions 0.2.0 and up until 1.0.0 (exclusively) are all compatible with Guzzle v4 and v5. To develop for these versions of Guzzle, use the guzzle4-5 branch., (*9)

Use, (*10)

Guzzle v3

If you want to continue to work with the old Guzzle v3 (Guzzle\Http\Client instead of GuzzleHttp\Client) ClockworkPlugin then you might want to install the 0.1.* releases. Pull request with Guzzle v3 compatibility should be made against the guzzle3 branch. Install the latest guzzle v3 compatible version with 0.1.* or dev-guzzle3., (*11)

Contributing

Feel free to make a pull request. Please try to be as PSR-2 compliant as possible. Fix Code Style quickly by running vendor/bin/php-cs-fixer fix. Give a good description of what is supposed to be added/changed/removed/fixed., (*12)

Testing

To test your code before pushing, run the unit test suite., (*13)

vendor/bin/phpunit

License

MIT, (*14)

The Versions

20/02 2018

dev-master

9999999-dev

A Guzzle middleware that logs requests with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware log php guzzle browser profiler profiling clockwork devtools

20/02 2018

1.1.0

1.1.0.0

A Guzzle middleware that logs requests with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware log php guzzle browser profiler profiling clockwork devtools

25/11 2015

1.0.0

1.0.0.0

A Guzzle middleware that logs requests with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware log php guzzle browser profiler profiling clockwork devtools

10/02 2015

dev-guzzle4-5

dev-guzzle4-5

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

10/02 2015

0.3.0

0.3.0.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

21/07 2014

v0.2.0

0.2.0.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

04/04 2014

dev-guzzle3

dev-guzzle3

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

04/04 2014

v0.1.4

0.1.4.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

17/03 2014

v0.1.3

0.1.3.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

18/02 2014

v0.1.2

0.1.2.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

17/02 2014

v0.1.1

0.1.1.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools

20/01 2014

v0.1.0

0.1.0.0

A Guzzle plugin that listens to events and logs them with Clockwork

  Sources   Download

MIT

The Requires

 

The Development Requires

log php events guzzle browser clockwork devtools