Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
DuraCloudConnection Class Reference

Public Member Functions

 _addData ($ch, $data)
 
 _buildUrlVars ($urlVars)
 
_curlOpenHandle ($username, $password)
 
 _makeHeaderList ($headers)
 
 _separateHeadersFromData ($response)
 
 delete ($path, $params=array())
 
 DuraCloudConnection ($baseUrl, $username, $password)
 
 get ($path, $params=array())
 
 getData ()
 
 getFile ($path, &$fp, $params=array())
 
 getHeaders ()
 
 head ($path, $params=array())
 
 post ($path, $params=array(), $headers=array())
 
 put ($path, $fp=null, $size=0, $params=array(), $headers=array())
 

Detailed Description

DuraCloud Connection class.

Definition at line 19 of file DuraCloudConnection.inc.php.

Member Function Documentation

DuraCloudConnection::_addData (   $ch,
  $data 
)

Used in getFile to read data from the server, toggling from headers to data

Definition at line 303 of file DuraCloudConnection.inc.php.

DuraCloudConnection::_buildUrlVars (   $urlVars)

Used internally to build a portion of a URL describing variables (from the '?' onwards).

Parameters
$array
Returns
string

Definition at line 277 of file DuraCloudConnection.inc.php.

Referenced by delete(), get(), getFile(), head(), and put().

& DuraCloudConnection::_curlOpenHandle (   $username,
  $password 
)

Open a cURL handle. Not for external use.

Parameters
$usernamestring
$passwordstring
Returns
object

Definition at line 232 of file DuraCloudConnection.inc.php.

Referenced by delete(), get(), getFile(), head(), post(), and put().

DuraCloudConnection::_makeHeaderList (   $headers)

Turn an associative array of headers into a list as CURLOPT_HTTPHEADER expects.

Parameters
$headersarray
Returns
array

Definition at line 292 of file DuraCloudConnection.inc.php.

Referenced by post(), and put().

DuraCloudConnection::_separateHeadersFromData (   $response)

Used internally to take a response and split it into headers and response data.

Parameters
$responsestring
Returns
array (headers, data) iff both headers and data were found; otherwise string data

Definition at line 262 of file DuraCloudConnection.inc.php.

Referenced by delete(), get(), head(), post(), and put().

DuraCloudConnection::delete (   $path,
  $params = array() 
)

Execute a DELETE request to DuraCloud. Not for external use.

Parameters
$pathstring
$paramsarray Associative array of URL parameters
$headersarray Associative array of HTTP headers

Definition at line 174 of file DuraCloudConnection.inc.php.

References _buildUrlVars(), _curlOpenHandle(), and _separateHeadersFromData().

DuraCloudConnection::DuraCloudConnection (   $baseUrl,
  $username,
  $password 
)

Construct a new DuraCloudConnection.

Parameters
$baseUrlBase URL to DuraCloud, i.e. https://pkp.duracloud.org
$usernameUsername
$passwordPassword

Definition at line 47 of file DuraCloudConnection.inc.php.

DuraCloudConnection::get (   $path,
  $params = array() 
)

Execute a GET request to DuraCloud. Not for external use.

Parameters
$pathstring
$paramsarray
Returns
string data

Definition at line 59 of file DuraCloudConnection.inc.php.

References _buildUrlVars(), _curlOpenHandle(), and _separateHeadersFromData().

DuraCloudConnection::getData ( )

Return the data resulting from the last successful operation

Returns
string

Definition at line 192 of file DuraCloudConnection.inc.php.

DuraCloudConnection::getFile (   $path,
$fp,
  $params = array() 
)

Execute a GET request to DuraCloud, returning output in a file. Not for external use.

Parameters
$pathstring
$paramsarray
Returns
false on failure, file size on success

Definition at line 77 of file DuraCloudConnection.inc.php.

References _buildUrlVars(), and _curlOpenHandle().

DuraCloudConnection::getHeaders ( )

Return the headers resulting from the last successful operation

Returns
array

Definition at line 200 of file DuraCloudConnection.inc.php.

Referenced by head(), and put().

DuraCloudConnection::head (   $path,
  $params = array() 
)

Execute a HEAD request to DuraCloud. Not for external use.

Parameters
$pathstring
$paramsarray
Returns
array headers

Definition at line 105 of file DuraCloudConnection.inc.php.

References _buildUrlVars(), _curlOpenHandle(), _separateHeadersFromData(), and getHeaders().

DuraCloudConnection::post (   $path,
  $params = array(),
  $headers = array() 
)

Execute a POST request to DuraCloud. Not for external use.

Parameters
$pathstring
$paramsarray Associative array of POST parameters

Definition at line 124 of file DuraCloudConnection.inc.php.

References _curlOpenHandle(), _makeHeaderList(), and _separateHeadersFromData().

DuraCloudConnection::put (   $path,
  $fp = null,
  $size = 0,
  $params = array(),
  $headers = array() 
)

Execute a PUT request to DuraCloud. Not for external use.

Parameters
$pathstring
$paramsarray Associative array of URL parameters
$headersarray Associative array of HTTP headers

Definition at line 146 of file DuraCloudConnection.inc.php.

References _buildUrlVars(), _curlOpenHandle(), _makeHeaderList(), _separateHeadersFromData(), and getHeaders().


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