OXID eShop CE  4.10.7
 All Classes Namespaces Files Functions Variables Pages
oxOnlineCaller Class Reference
+ Inheritance diagram for oxOnlineCaller:
+ Collaboration diagram for oxOnlineCaller:

Public Member Functions

 __construct (oxCurl $oCurl, oxOnlineServerEmailBuilder $oEmailBuilder, oxSimpleXml $oSimpleXml)
 call (oxOnlineRequest $oRequest)

Public Attributes

const ALLOWED_HTTP_FAILED_CALLS_COUNT = 4
const CURL_EXECUTION_TIMEOUT = 5

Protected Member Functions

 _getXMLDocumentName ()
 _getServiceUrl ()
 _formEmail ($oRequest)
 _formXMLRequest ($oRequest)
 _getSimpleXml ()
 _getCurl ()
 _getEmailBuilder ()

Private Member Functions

 _executeCurlCall ($sUrl, $sXml)
 _sendEmail ($sBody)
 _resetFailedCallsCount ($iFailedOnlineCallsCount)
 _increaseFailedCallsCount ($iFailedOnlineCallsCount)

Private Attributes

 $_oCurl
 $_oEmailBuilder
 $_oSimpleXml

Detailed Description

Class oxOnlineCaller makes call to given URL which is taken from child classes and sends request parameter.

Definition at line 11 of file oxonlinecaller.php.

Constructor & Destructor Documentation

oxOnlineCaller::__construct ( oxCurl  $oCurl,
oxOnlineServerEmailBuilder  $oEmailBuilder,
oxSimpleXml  $oSimpleXml 
)

Sets dependencies.

Parameters
oxCurl$oCurl
oxOnlineServerEmailBuilder$oEmailBuilder
oxSimpleXml$oSimpleXml

Definition at line 55 of file oxonlinecaller.php.

Member Function Documentation

oxOnlineCaller::_executeCurlCall (   $sUrl,
  $sXml 
)
private

Executes CURL call with given parameters.

Parameters
string$sUrl
string$sXml
Returns
string

Definition at line 157 of file oxonlinecaller.php.

oxOnlineCaller::_formEmail (   $oRequest)
protected

Forms email.

Parameters
oxOnlineRequest$oRequest
Returns
string

Reimplemented in oxOnlineLicenseCheckCaller.

Definition at line 102 of file oxonlinecaller.php.

oxOnlineCaller::_formXMLRequest (   $oRequest)
protected

Forms XML request.

Parameters
oxOnlineRequest$oRequest
Returns
string

Definition at line 114 of file oxonlinecaller.php.

oxOnlineCaller::_getCurl ( )
protected

Gets curl.

Returns

Definition at line 134 of file oxonlinecaller.php.

oxOnlineCaller::_getEmailBuilder ( )
protected

Gets email builder.

Returns
oxOnlineServerEmailBuilder

Definition at line 144 of file oxonlinecaller.php.

oxOnlineCaller::_getServiceUrl ( )
abstractprotected

Gets service url.

Returns
string Web service url.

Reimplemented in oxOnlineLicenseCheckCaller, and oxOnlineModuleVersionNotifierCaller.

oxOnlineCaller::_getSimpleXml ( )
protected

Gets simple XML.

Returns
oxSimpleXml

Definition at line 124 of file oxonlinecaller.php.

oxOnlineCaller::_getXMLDocumentName ( )
abstractprotected

Gets XML document name.

Returns
string XML document tag name.

Reimplemented in oxOnlineLicenseCheckCaller, and oxOnlineModuleVersionNotifierCaller.

oxOnlineCaller::_increaseFailedCallsCount (   $iFailedOnlineCallsCount)
private

increases failed calls count.

Parameters
int$iFailedOnlineCallsCount

Definition at line 200 of file oxonlinecaller.php.

oxOnlineCaller::_resetFailedCallsCount (   $iFailedOnlineCallsCount)
private

Resets config parameter iFailedOnlineCallsCount if it's bigger than 0.

Parameters
int$iFailedOnlineCallsCount

Definition at line 188 of file oxonlinecaller.php.

oxOnlineCaller::_sendEmail (   $sBody)
private

Sends an email with server information.

Parameters
string$sBody

Definition at line 177 of file oxonlinecaller.php.

oxOnlineCaller::call ( oxOnlineRequest  $oRequest)

Makes curl call with given parameters to given url.

Parameters
oxOnlineRequest$oRequest
Returns
null|string In XML format.

Definition at line 69 of file oxonlinecaller.php.

Member Data Documentation

oxOnlineCaller::$_oCurl
private

Definition at line 22 of file oxonlinecaller.php.

oxOnlineCaller::$_oEmailBuilder
private

Definition at line 27 of file oxonlinecaller.php.

oxOnlineCaller::$_oSimpleXml
private

Definition at line 32 of file oxonlinecaller.php.

const oxOnlineCaller::ALLOWED_HTTP_FAILED_CALLS_COUNT = 4

Definition at line 14 of file oxonlinecaller.php.

const oxOnlineCaller::CURL_EXECUTION_TIMEOUT = 5

Amount of seconds for curl execution timeout.

Definition at line 17 of file oxonlinecaller.php.


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