class LoggingClient implements Client (View source)

Properties

array $requests Array of requests made to CouchDB with this client.
float $totalDuration

Methods

__construct(Client $client)

Construct new logging client wrapping the real client.

request(string $method, string $path, string $data = null, bool $raw = false, array $headers = [])

Perform a request to the server and return the result.

resource
getConnection(string $method, string $path, string $data = null, array $headers = [])

Return the connection pointer or connection socket after setting up the connection.

Details

__construct(Client $client)

Construct new logging client wrapping the real client.

Parameters

Client $client

Response request(string $method, string $path, string $data = null, bool $raw = false, array $headers = [])

Perform a request to the server and return the result.

Perform a request to the server and return the result converted into a Response object. If you do not expect a JSON structure, which could be converted in such a response object, set the fourth parameter to true, and you get a response object returned, containing the raw body. Optional HTTP request headers can be passed in an array using the fifth parameter.

Parameters

string $method
string $path
string $data
bool $raw
array $headers

Return Value

Response

resource getConnection(string $method, string $path, string $data = null, array $headers = [])

Return the connection pointer or connection socket after setting up the connection.

Return the connection pointer (for stream connection) or connection socket (for socket connection) after setting up the connection. The returned resource can be used to read and write data in small chunks reducing the memory usage.

Parameters

string $method
string $path
string $data
array $headers

Return Value

resource