ucloud storage php doc
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields
CF_Authentication Class Reference

Public Member Functions

 __construct ($username=NULL, $api_key=NULL, $auth_host=AUTHURL)
 
 ssl_use_cabundle ($path=NULL)
 
 authenticate ($version=DEFAULT_CF_API_VERSION)
 
 load_cached_credentials ($auth_token, $storage_url)
 
 export_credentials ()
 
 authenticated ()
 
 setDebug ($bool)
 

Data Fields

 $dbug
 
 $username
 
 $api_key
 
 $auth_host
 
 $account
 
 $storage_url
 
 $auth_token
 
 $cfs_http
 

Detailed Description

Definition at line 99 of file cloudfiles-kt.php.

Constructor & Destructor Documentation

__construct (   $username = NULL,
  $api_key = NULL,
  $auth_host = AUTHURL 
)

Class constructor (PHP 5 syntax)

Parameters
string$usernameucloudbiz_Æ÷Å»_ID
string$api_keyAPI Access Key
string$accountAccount name
string$auth_hostAuthentication service URI

Definition at line 122 of file cloudfiles-kt.php.

Member Function Documentation

authenticate (   $version = DEFAULT_CF_API_VERSION)

Attempt to validate Username/API Access Key

Attempts to validate credentials with the authentication service. It either returns True or throws an Exception. Accepts a single (optional) argument for the storage system API version.

Example: Create the authentication instance

$auth = new CF_Authentication("username", "api_key");

Perform authentication request

$auth->authenticate();

Parameters
string$versionAPI version for Auth service (optional)
Returns
boolean True if successfully authenticated
Exceptions
AuthenticationExceptioninvalid credentials
InvalidResponseExceptioninvalid response

Definition at line 185 of file cloudfiles-kt.php.

authenticated ( )

Make sure the CF_Authentication instance has authenticated.

Ensures that the instance variables necessary to communicate with Cloud Files have been set from a previous authenticate() call.

Returns
boolean True if successfully authenticated

Definition at line 271 of file cloudfiles-kt.php.

export_credentials ( )

Grab Cloud Files info to be Cached for later use with the load_cached_credentials method.

Example: Create an Auth instance $auth = new CF_Authentication("UserName","API_Key"); $auth->authenticate(); $array = $auth->export_credentials();

Returns
array of a storage url and an auth token.

Definition at line 254 of file cloudfiles-kt.php.

load_cached_credentials (   $auth_token,
  $storage_url 
)

Use Cached Token and Storage URL's rather then grabbing from the Auth System

Example: Create an Auth instance $auth = new CF_Authentication(); Pass Cached URL's and Token as Args $auth->load_cached_credentials("auth_token", "storage_url");

Parameters
string$auth_tokenA Cloud Files Auth Token (Required)
string$storage_urlThe Cloud Files Storage URL (Required)
Returns
boolean True if successful
Exceptions
SyntaxExceptionIf any of the Required Arguments are missing

Definition at line 223 of file cloudfiles-kt.php.

setDebug (   $bool)

Toggle debugging - set cURL verbose flag

Definition at line 282 of file cloudfiles-kt.php.

ssl_use_cabundle (   $path = NULL)

Use the Certificate Authority bundle included with this API

Most versions of PHP with cURL support include an outdated Certificate Authority (CA) bundle (the file that lists all valid certificate signing authorities). The SSL certificates used by the Cloud Files storage system are perfectly valid but have been created/signed by a CA not listed in these outdated cURL distributions.

As a work-around, we've included an updated CA bundle obtained directly from cURL's web site (http://curl.haxx.se). You can direct the API to use this CA bundle by calling this method prior to making any remote calls. The best place to use this method is right after the CF_Authentication instance has been instantiated.

You can specify your own CA bundle by passing in the full pathname to the bundle. You can use the included CA bundle by leaving the argument blank.

Parameters
string$pathSpecify path to CA bundle (default to included)

Definition at line 157 of file cloudfiles-kt.php.

Field Documentation

$account

Definition at line 105 of file cloudfiles-kt.php.

$api_key

Definition at line 103 of file cloudfiles-kt.php.

$auth_host

Definition at line 104 of file cloudfiles-kt.php.

$auth_token

Definition at line 111 of file cloudfiles-kt.php.

$cfs_http

Definition at line 112 of file cloudfiles-kt.php.

$dbug

Definition at line 101 of file cloudfiles-kt.php.

$storage_url

Instance variables that are set after successful authentication

Definition at line 110 of file cloudfiles-kt.php.

$username

Definition at line 102 of file cloudfiles-kt.php.


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