Class History
- Aws\History implements Countable, IteratorAggregate
- Namespace: Aws
- Located at History.php
Represents a history container that is required when using the history middleware.
Methods Summary
- __construct ( int $maxEntries = 10 )
- count ( )
- getIterator ( )
-
getLastCommand ( )
Get the last finished command seen by the history container.
-
getLastRequest ( )
Get the last finished request seen by the history container.
-
getLastReturn ( )
Get the last received result or exception.
-
start ( Aws\CommandInterface $cmd, Psr\Http\Message\RequestInterface $req )
Initiate an entry being added to the history.
-
finish ( string $ticket, mixed $result )
Finish adding an entry to the history container.
-
clear ( )
Flush the history
-
toArray ( )
Converts the history to an array.
Methods Details
__construct ( integer $maxEntries = 10 )
Parameters
integer | $maxEntries = 10 | Maximum number of entries to store. |
count ( )
Implementation of
Countable::count()
getIterator ( )
Implementation of
IteratorAggregate::getIterator()
Aws\CommandInterface
getLastCommand (
)
Get the last finished command seen by the history container.
Returns
Aws\CommandInterface |
Exceptions
LogicException if no commands have been seen. |
Psr\Http\Message\RequestInterface
getLastRequest (
)
Get the last finished request seen by the history container.
Returns
Psr\Http\Message\RequestInterface |
Exceptions
LogicException if no requests have been seen. |
Aws\ResultInterface
|Aws\Exception\AwsException
getLastReturn (
)
Get the last received result or exception.
Returns
Aws\ResultInterface |Aws\Exception\AwsException |
Exceptions
LogicException if no return values have been received. |
string
start (
Aws\CommandInterface
$cmd,
Psr\Http\Message\RequestInterface
$req
)
Initiate an entry being added to the history.
Parameters
Aws\CommandInterface |
$cmd | Command be executed. |
Psr\Http\Message\RequestInterface |
$req | Request being sent. |
Returns
string Returns the ticket used to finish the entry. |
finish ( string $ticket, mixed $result )
Finish adding an entry to the history container.
Parameters
string | $ticket | Ticket returned from the start call. |
mixed | $result | The result (an exception or AwsResult). |
clear ( )
Flush the history
array toArray ( )
Converts the history to an array.
Returns
array |