OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxCurl Class Reference

Public Member Functions

 setUrl ($sUrl)
 getUrl ()
 setQuery ($sQuery)
 getQuery ()
 setParameters ($aParameters)
 getParameters ()
 setHost ($sHost)
 getHost ()
 setHeader ($aHeader=null)
 getHeader ()
 setMethod ($sMethod)
 getMethod ()
 setOption ($sName, $sValue)
 getOptions ()
 execute ()
 setConnectionCharset ($sCharset)
 getConnectionCharset ()
 getStatusCode ()

Protected Member Functions

 _setResource ($rCurl)
 _getResource ()
 _setOptions ()
 _execute ()
 _close ()
 _setOpt ($sName, $sValue)
 _getErrorNumber ()
 _saveStatusCode ()
 _prepareQueryParameters ($aParams)
 _htmlDecode ($mParam)

Protected Attributes

 $_rCurl = null
 $_sUrl = null
 $_sQuery = null
 $_sMethod = 'POST'
 $_aParameters = null
 $_sConnectionCharset = "UTF-8"
 $_aHeader = null
 $_sHost = null
 $_aOptions = array('CURLOPT_RETURNTRANSFER' => 1)
 $_sStatusCode = null

Detailed Description

CURL request handler. Handles CURL calls

Definition at line 9 of file oxcurl.php.

Member Function Documentation

oxCurl::_close ( )
protected

Wrapper function to be mocked for testing.

Returns
null

Definition at line 390 of file oxcurl.php.

oxCurl::_execute ( )
protected

Wrapper function to be mocked for testing.

Returns
string

Definition at line 380 of file oxcurl.php.

oxCurl::_getErrorNumber ( )
protected

Check if curl has errors. Set error message if has.

Returns
int

Definition at line 412 of file oxcurl.php.

oxCurl::_getResource ( )
protected

Returns curl resource

Returns
resource

Definition at line 344 of file oxcurl.php.

oxCurl::_htmlDecode (   $mParam)
protected

Decode (if needed) html entity.

Parameters
mixed$mParamquery
Returns
string

Definition at line 446 of file oxcurl.php.

oxCurl::_prepareQueryParameters (   $aParams)
protected

Clears empty values from array and decodes html entities.

Parameters
$aParams
Returns
array

Definition at line 431 of file oxcurl.php.

oxCurl::_saveStatusCode ( )
protected

Sets current request HTTP status code.

Definition at line 420 of file oxcurl.php.

oxCurl::_setOpt (   $sName,
  $sValue 
)
protected

Wrapper function to be mocked for testing.

Parameters
string$sNamecurl option name to set value to.
string$sValuecurl option value to set.

Definition at line 402 of file oxcurl.php.

oxCurl::_setOptions ( )
protected

Set Curl Options

Definition at line 355 of file oxcurl.php.

oxCurl::_setResource (   $rCurl)
protected

Sets resource

Parameters
resource$rCurlcurl.

Definition at line 334 of file oxcurl.php.

oxCurl::execute ( )

Executes curl call and returns response data as associative array.

Exceptions
oxExceptionon curl errors
Returns
string

Definition at line 275 of file oxcurl.php.

oxCurl::getConnectionCharset ( )

Return connection charset

Returns
string

Definition at line 314 of file oxcurl.php.

oxCurl::getHeader ( )

Forms header from host.

Returns
array

Definition at line 203 of file oxcurl.php.

oxCurl::getHost ( )

Returns host.

Returns
string

Definition at line 170 of file oxcurl.php.

oxCurl::getMethod ( )

Return method to send

Returns
string

Definition at line 228 of file oxcurl.php.

oxCurl::getOptions ( )

Gets all options for a cURL transfer

Returns
array

Definition at line 263 of file oxcurl.php.

oxCurl::getParameters ( )

Return parameters to be added to call url.

return array

Definition at line 148 of file oxcurl.php.

oxCurl::getQuery ( )

Builds query like "param1=value1&param2=values2.."

Returns
string

Definition at line 118 of file oxcurl.php.

oxCurl::getStatusCode ( )

Return HTTP status code.

Returns
int HTTP status code.

Definition at line 324 of file oxcurl.php.

oxCurl::getUrl ( )

Get url

Returns
string

Definition at line 97 of file oxcurl.php.

oxCurl::setConnectionCharset (   $sCharset)

Set connection charset

Parameters
string$sCharsetcharset

Definition at line 304 of file oxcurl.php.

oxCurl::setHeader (   $aHeader = null)

Set header.

Parameters
array$aHeader
Returns
null

Definition at line 182 of file oxcurl.php.

oxCurl::setHost (   $sHost)

Sets host.

Parameters
string$sHost
Returns
null

Definition at line 160 of file oxcurl.php.

oxCurl::setMethod (   $sMethod)

Set method to send (POST/GET)

Parameters
string$sMethodmethod to send (POST/GET)
Returns
null

Definition at line 218 of file oxcurl.php.

oxCurl::setOption (   $sName,
  $sValue 
)

Sets an option for a cURL transfer

Parameters
string$sNamecurl option name to set value to.
string$sValuecurl option value to set.
Exceptions
oxExceptionon curl errors
Returns
null

Definition at line 243 of file oxcurl.php.

oxCurl::setParameters (   $aParameters)

Sets parameters to be added to call url.

Parameters
array$aParametersparameters

Definition at line 137 of file oxcurl.php.

oxCurl::setQuery (   $sQuery)

Set query like "param1=value1&param2=values2.."

Definition at line 108 of file oxcurl.php.

oxCurl::setUrl (   $sUrl)

Sets url to call

Parameters
string$sUrlURL to call.
Exceptions
oxExceptionif url is not valid
Returns
null

Definition at line 87 of file oxcurl.php.

Member Data Documentation

oxCurl::$_aHeader = null
protected

Definition at line 56 of file oxcurl.php.

oxCurl::$_aOptions = array('CURLOPT_RETURNTRANSFER' => 1)
protected

Definition at line 69 of file oxcurl.php.

oxCurl::$_aParameters = null
protected

Definition at line 44 of file oxcurl.php.

oxCurl::$_rCurl = null
protected

Definition at line 16 of file oxcurl.php.

oxCurl::$_sConnectionCharset = "UTF-8"
protected

Definition at line 50 of file oxcurl.php.

oxCurl::$_sHost = null
protected

Definition at line 62 of file oxcurl.php.

oxCurl::$_sMethod = 'POST'
protected

Set CURL method

Returns
string

Definition at line 37 of file oxcurl.php.

oxCurl::$_sQuery = null
protected

Query like "param1=value1&param2=values2.."

Returns
string

Definition at line 30 of file oxcurl.php.

oxCurl::$_sStatusCode = null
protected

Definition at line 76 of file oxcurl.php.

oxCurl::$_sUrl = null
protected

Definition at line 23 of file oxcurl.php.


The documentation for this class was generated from the following file: