blend4php  v0.1
A PHP API for interacting with Galaxy
 All Classes Functions Variables Pages
GalaxyHTTPRequest Class Reference
Inheritance diagram for GalaxyHTTPRequest:
GalaxyInstance

Public Member Functions

 __construct ()
 
 httpGET ($URL, $curl_options=array())
 
 httpPOST ($URL, $input=NULL)
 
 httpPUT ($URL, $input=NULL)
 
 httpPATCH ($URL, $input=NULL)
 
 getRemoteFile ($URL, $file_name)
 
 uploadFile ($URL, $data, $files)
 
 httpDELETE ($URL, $input=NULL)
 
 auth ($URL, $username, $password)
 
 getError ()
 
 getErrorMessage ()
 
 getErrorType ()
 
 setError ($type, $message)
 
 expectArray ($response)
 

Constructor & Destructor Documentation

GalaxyHTTPRequest::__construct ( )

The GalaxyHTTPRequest constructor.

Returns
An instance of a GalaxyHTTPRequest class.

Member Function Documentation

GalaxyHTTPRequest::auth (   $URL,
  $username,
  $password 
)
Parameters
unknown$URL
unknown$username
unknown$password
GalaxyHTTPRequest::expectArray (   $response)

Checks if the provided value is an array and sets an error if not.

This is a helper function to help children class deal with the case when Galaxy does not return a JSON array as expected. Sometimes when there is an error the error message is returned in a JSON array and can be handled by our getCURLResponse function. But otherwise that function can't distinguish between a string that is returned and an error. So, this function allows children class to check that the response is an array if they expect that it should be.

Parameters
$response
GalaxyHTTPRequest::getError ( )

A wrapper function for retrieving an error.

Interacts with the GalaxyError object which is a private member of this class.

See Also
GalaxyError::getError()
GalaxyHTTPRequest::getErrorMessage ( )

A wrapper function for retrieving an error message.

Interacts with the GalaxyError object which is a private member of this class.

See Also
GalaxyError::getErrorMessage()
GalaxyHTTPRequest::getErrorType ( )

A wrapper function for retrieving an error type.

Interacts with the GalaxyError object which is a private member of this class.

See Also
GalaxyError::getErrorType()
GalaxyHTTPRequest::getRemoteFile (   $URL,
  $file_name 
)
Parameters
$URL
$file_name
Returns
GalaxyHTTPRequest::httpDELETE (   $URL,
  $input = NULL 
)

Universal DELETE request

Parameters
$inputThe input data to give to the url.
$URLThe path to perform the DELETE request.
Returns
curl server response
GalaxyHTTPRequest::httpGET (   $URL,
  $curl_options = array() 
)

Performs a GET request.

Parameters
$URLThe URL for the GET.
$curl_optionsAny additional information to retreive from the resource while the GET request.
Returns
curl server response.
GalaxyHTTPRequest::httpPATCH (   $URL,
  $input = NULL 
)

Perform a PATCH request

Parameters
$URLThe URL for the PATCH request.
$inputThe input data to give to the URL.
Returns
curl server response.
GalaxyHTTPRequest::httpPOST (   $URL,
  $input = NULL 
)

Perform a POST request.

Parameters
$URLThe url for the POST.
$inputThe input data to a given URL.
Returns
curl server response.
GalaxyHTTPRequest::httpPUT (   $URL,
  $input = NULL 
)

Perform a PUT request

Parameters
$URLThe URL for the PUT
$inputThe input data to give to the URL.
Returns
An associative array containing the response from the Galaxy server or FALSE if an error occured. If FALSE then use the getError() function to retrieve the error message and type.
GalaxyHTTPRequest::setError (   $type,
  $message 
)

A wrapper function for setting an error.

Interacts with the GalaxyError object which is a private member of this class.

See Also
GalaxyError::setError()
GalaxyHTTPRequest::uploadFile (   $URL,
  $data,
  $files 
)

Upload file request

Parameters
$dataThe input data to give to the url.
$URLThe path to perform the DELETE request.
$filesThe file(s) to post to the specified URL
Returns
curl server response

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