itsgoingd / clockwork

Clockwork - php dev tools in your browser - server-side component
https://underground.works/clockwork
MIT License
5.69k stars 321 forks source link

Support for collecting HTTP client requests #693

Closed itsgoingd closed 8 months ago

itsgoingd commented 8 months ago

Example usage of the Guzzle integration:

// Instantiate the Guzzle data source
$guzzleDataSource = new \Clockwork\DataSource\GuzzleDataSource;

// Option 1 - Get a new Guzzle instance w/ Clockwork support
$guzzle = $guzzleDataSource->instance([ 'verify' => false ]);

// Option 2 - Extend a Guzzle configuration array w/ Clockwork support
$guzzle = new \GuzzleHttp\Client($guzzleDataSource->configure([ 'verify' => false ]));

// Option 3 - Manually instantiate a Guzzle instance w/ Clockwork support
$handler = \GuzzleHttp\HandlerStack::create();      
$handler->push($guzzleDataSource);
$guzzle = new \GuzzleHttp\Client([ 'handler' => $handler, 'verify' => false ]);

// Add the data source to your Clockwork instance
$clockwork->addDataSource($guzzleDataSource);
mstaack commented 8 months ago

just great! thank you