HPCloud-PHP  1.2.0
PHP bindings for HPCloud and OpenStack services.
 All Classes Namespaces Files Functions Variables Pages
Transport Class Reference

Provide an HTTP client (Transporter) for interaction with HPCloud. More...

Static Public Member Functions

static instance ()
 Get an instance of a Transporter.
static reset ()
 Rebuild the transporter.

Static Protected Attributes

static $inst = NULL

Detailed Description

Provide an HTTP client (Transporter) for interaction with HPCloud.

Interaction with the OpenStack/HPCloud services is handled via HTTPS/REST requests. This class provides transport for requests.

Usage

<?php
// Create a new transport.
$client = Transport::instance();
// Send a request.
$response = $client->doRequest($uri, $method, $headerArray, $body);
print $response->content();
?>

Definition at line 48 of file Transport.php.

Member Function Documentation

static instance ( )
static

Get an instance of a Transporter.

See HPCloud::Transport::CURLTransport and HPCloud::Transport::PHPStreamTransport for implementations of an HPCloud::Transport::Transporter.

To set the transport, the suggested method is this:

<?php
// Set the 'transport' config option.
$settings = array(
// Make sure you use the entire namespace, and that
// your classloader can find this namespace.
'transport' => '\HPCloud\Transport\CURLTransport',
);
// Merge $settings into existing configuration.
\HPCloud\Bootstrap::setConfiguration($settings);
?>
Return values
HPCloud::Transport::Transporter
Returns
An initialized transporter.

Definition at line 78 of file Transport.php.

static reset ( )
static

Rebuild the transporter.

This will rebuild the client transporter, re-reading any configuration data in the process.

Definition at line 93 of file Transport.php.

Member Data Documentation

$inst = NULL
staticprotected

Definition at line 50 of file Transport.php.


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