PHP Class Doctrine\OrientDB\Binding\Client\Http\CurlClient

Show file Open project: doctrine/orientdb-odm Class Usage Examples

Protected Properties

Property Type Description
$authentication
$cookies
$curl
$restart

Public Methods

Method Description
__construct ( boolean $restart = false, integer $timeout = 10 ) Creates a new HTTP client based on cURL.
__destruct ( ) Closes the underlying cURL handle.
delete ( String $location, $body = null ) : CurlClientResponse Executes a DELETE on a resource.
execute ( String $method, String $location ) : CurlClientResponse Executes a Curl.
get ( String $location ) : CurlClientResponse GETs a resource.
post ( String $location, String $body ) : CurlClientResponse Executes a POST on a location.
put ( String $location, String $body ) : CurlClientResponse PUTs a resource.
restart ( ) Reinitializes the client for a completely new session.
setAuthentication ( String $credentials ) Sets the authentication string for the next HTTP requests.
setHeader ( type $header, type $value ) Sets an HTTP header to send within the request.
setTimeout ( integer $timeout ) Sets a timeout for the current cURL handler's requests.

Protected Methods

Method Description
createCurlHandle ( ) : resource Creates and initializes the underlying cURL handle.
getDefaultCurlOptions ( ) : array Returns an array with a set of default options for cURL.
getRequestCookies ( ) : string Returns a string with the list of cookies for the Cookie header.

Method Details

__construct() public method

Creates a new HTTP client based on cURL.
public __construct ( boolean $restart = false, integer $timeout = 10 )
$restart boolean
$timeout integer

__destruct() public method

Closes the underlying cURL handle.
public __destruct ( )

createCurlHandle() protected method

Creates and initializes the underlying cURL handle.
protected createCurlHandle ( ) : resource
return resource

delete() public method

Executes a DELETE on a resource.
public delete ( String $location, $body = null ) : CurlClientResponse
$location String
return CurlClientResponse

execute() public method

Executes a Curl.
public execute ( String $method, String $location ) : CurlClientResponse
$method String
$location String
return CurlClientResponse

get() public method

GETs a resource.
public get ( String $location ) : CurlClientResponse
$location String
return CurlClientResponse

getDefaultCurlOptions() protected method

Returns an array with a set of default options for cURL.
protected getDefaultCurlOptions ( ) : array
return array

getRequestCookies() protected method

Returns a string with the list of cookies for the Cookie header.
protected getRequestCookies ( ) : string
return string

post() public method

Executes a POST on a location.
public post ( String $location, String $body ) : CurlClientResponse
$location String
$body String
return CurlClientResponse

put() public method

PUTs a resource.
public put ( String $location, String $body ) : CurlClientResponse
$location String
$body String
return CurlClientResponse

restart() public method

Reinitializes the client for a completely new session.
public restart ( )

setAuthentication() public method

Sets the authentication string for the next HTTP requests.
public setAuthentication ( String $credentials )
$credentials String

setHeader() public method

Sets an HTTP header to send within the request.
public setHeader ( type $header, type $value )
$header type
$value type

setTimeout() public method

Sets a timeout for the current cURL handler's requests.
public setTimeout ( integer $timeout )
$timeout integer

Property Details

$authentication protected property

protected $authentication

$cookies protected property

protected $cookies

$curl protected property

protected $curl

$restart protected property

protected $restart