wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
HTTPClient Class Reference

Public Member Functions

 __construct ($serverUrl, $user)
 
 call ($request)
 

Protected Member Functions

 doRemoteCall ($request, $isLogin)
 
 doLogin ()
 
 handleError ($response)
 

Private Attributes

 $_client = null
 
 $_user = null
 

Detailed Description

HTTPClient is used to do calls to other wCMF instances over HTTP.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 33 of file class.HTTPClient.php.

Constructor & Destructor Documentation

HTTPClient::__construct (   $serverUrl,
  $user 
)

Constructor

Parameters
serverUrlThe url of the other server instance.
userThe remote user instance.

Definition at line 43 of file class.HTTPClient.php.

Member Function Documentation

HTTPClient::call (   $request)

Do a call to the remote server.

Parameters
requestA Request instance
Returns
A Response instance

Definition at line 59 of file class.HTTPClient.php.

References doRemoteCall().

+ Here is the call graph for this function:

HTTPClient::doRemoteCall (   $request,
  $isLogin 
)
protected

Do a remote call.

Parameters
requestThe Request instance
isLoginTrue/False wether this request is a login request or not
Returns
The Response instance

Definition at line 70 of file class.HTTPClient.php.

References JSONUtil\decode(), Formatter\deserialize(), doLogin(), Log\error(), MSG_FORMAT_JSON, and WCMFException\throwEx().

Referenced by call(), and doLogin().

+ Here is the call graph for this function:

HTTPClient::doLogin ( )
protected

Do the login request. If the request is successful, the session id will be set.

Returns
True on success

Definition at line 121 of file class.HTTPClient.php.

References doRemoteCall(), and WCMFException\throwEx().

Referenced by doRemoteCall().

+ Here is the call graph for this function:

HTTPClient::handleError (   $response)
protected

Error handling method

Parameters
responseThe Response instance

Definition at line 149 of file class.HTTPClient.php.

References Log\error(), and WCMFException\throwEx().

+ Here is the call graph for this function:

Member Data Documentation

HTTPClient::$_client = null
private

Definition at line 35 of file class.HTTPClient.php.

HTTPClient::$_user = null
private

Definition at line 36 of file class.HTTPClient.php.


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