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 | |
Definition at line 99 of file cloudfiles-kt.php.
__construct | ( | $username = NULL , |
|
$api_key = NULL , |
|||
$auth_host = AUTHURL |
|||
) |
Class constructor (PHP 5 syntax)
string | $username | ucloudbiz_Æ÷Å»_ID |
string | $api_key | API Access Key |
string | $account | Account name |
string | $auth_host | Authentication service URI |
Definition at line 122 of file cloudfiles-kt.php.
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();
string | $version | API version for Auth service (optional) |
True
if successfully authenticated AuthenticationException | invalid credentials |
InvalidResponseException | invalid 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.
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();
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");
string | $auth_token | A Cloud Files Auth Token (Required) |
string | $storage_url | The Cloud Files Storage URL (Required) |
True
if successful SyntaxException | If 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.
string | $path | Specify path to CA bundle (default to included) |
Definition at line 157 of file cloudfiles-kt.php.
$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.