\Guzzle\Plugin\HistoryHistoryPlugin

Maintains a list of requests and responses sent using a request or client

Summary

Methods
Properties
Constants
getSubscribedEvents()
__toString()
add()
setLimit()
getLimit()
getAll()
getIterator()
count()
getLastRequest()
getLastResponse()
clear()
onRequestSent()
No public properties found
No constants found
No protected methods found
$limit
$transactions
N/A
No private methods found
No private properties found
N/A

Properties

$limit

$limit : integer

Type

integer — The maximum number of requests to maintain in the history

$transactions

$transactions : array

Type

array — Requests and responses that have passed through the plugin

Methods

getSubscribedEvents()

getSubscribedEvents() : array

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

  • The method name to call (priority defaults to 0)
  • An array composed of the method name to call and the priority
  • An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

  • array('eventName' => 'methodName')
  • array('eventName' => array('methodName', $priority))
  • array('eventName' => array(array('methodName1', $priority), array('methodName2')))

Returns

array —

The event names to listen to

__toString()

__toString() : string

Convert to a string that contains all request and response headers

Returns

string

setLimit()

setLimit(integer  $limit) : \Guzzle\Plugin\History\HistoryPlugin

Set the max number of requests to store

Parameters

integer $limit

Limit

Returns

\Guzzle\Plugin\History\HistoryPlugin

getLimit()

getLimit() : integer

Get the request limit

Returns

integer

getAll()

getAll() : array

Get all of the raw transactions in the form of an array of associative arrays containing 'request' and 'response' keys.

Returns

array

getIterator()

getIterator() : \ArrayIterator

Get the requests in the history

Returns

\ArrayIterator

count()

count() : integer

Get the number of requests in the history

Returns

integer

getLastResponse()

getLastResponse() : \Guzzle\Http\Message\Response|null

Get the last response in the history

Returns

\Guzzle\Http\Message\Response|null