Zend_Service_Rackspace_Files

category Zend
package Zend_Service
subpackage Rackspace
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Service_Rackspace_Abstract

 Methods

Constructor

__construct(string $user, string $key, string $authUrl = self::US_AUTH_URL
Inherited

You must pass the account and the Rackspace authentication key. Optional: the authentication url (default is US)

Parameters

$user

string

$key

string

$authUrl

string

Authentication

authenticate() : boolean
Inherited

Returns

boolean

Copy an object from a container to another

copyObject(string $container_source, string $obj_source, string $container_dest, string $obj_dest, array $metadata = array(), string $content_type = null) : boolean

Parameters

$container_source

string

$obj_source

string

$container_dest

string

$obj_dest

string

$metadata

array

$content_type

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean

Create a container

createContainer(string $container, array $metadata = array()) : boolean | \Zend_Service_Rackspace_Files_Container

Parameters

$container

string

$metadata

array

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean\Zend_Service_Rackspace_Files_Container

Delete a container (only if it's empty)

deleteContainer(string $container) : boolean

Parameters

$container

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean

Delete an object in a container

deleteObject(string $container, string $object) : boolean

Parameters

$container

string

$object

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean

Enable the CDN for a container

enableCdnContainer(string $container, integer $ttl = self::CDN_TTL_MIN) : array | boolean

Parameters

$container

string

$ttl

integer

Exceptions

\Zend_Service_Rackspace_Exception

Returns

arrayboolean

Get authentication URL

getAuthUrl() : string
Inherited

Returns

string

Get all the CDN containers

getCdnContainers(array $options = array()) : array | boolean

Parameters

$options

array

Returns

arrayboolean

Get the CDN URL

getCdnUrl() : string | boolean
Inherited

Returns

stringboolean

Get a container

getContainer(string $container) : \Zend_Service_Rackspace_Files_Container | boolean

Parameters

$container

string

Returns

\Zend_Service_Rackspace_Files_Containerboolean

Get all the containers

getContainers(array $options = array()) : \Zend_Service_Rackspace_Files_ContainerList | boolean

Parameters

$options

array

Returns

\Zend_Service_Rackspace_Files_ContainerListboolean

Return the total count of containers

getCountContainers() : integer

Returns

integer

Return the count of objects contained in all the containers

getCountObjects() : integer

Returns

integer

Get the error code of the last HTTP call

getErrorCode() : \strig
Inherited

Returns

\strig

Get the error msg of the last HTTP call

getErrorMsg() : string
Inherited

Returns

string

get the HttpClient instance

getHttpClient() : \Zend_Http_Client
Inherited

Returns

\Zend_Http_Client

Get the metadata information of the accounts: - total count containers - size in bytes of all the containers - total objects in all the containers

getInfoAccount() : array | boolean

Returns

arrayboolean

Get the information of a Cdn container

getInfoCdnContainer(string $container) : array | boolean

Parameters

$container

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

arrayboolean

Get user key

getKey() : string
Inherited

Returns

string

Get the management server URL

getManagementUrl() : string | boolean
Inherited

Returns

stringboolean

Get the metadata of a container

getMetadataContainer(string $container) : array | boolean

Parameters

$container

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

arrayboolean

Get the metadata of an object

getMetadataObject(string $container, string $object) : array | boolean

Parameters

$container

string

$object

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

arrayboolean

Get an object in a container

getObject(string $container, string $object, array $headers = array()) : boolean | \Zend_Service_Rackspace_Files_Object

Parameters

$container

string

$object

string

$headers

array

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean\Zend_Service_Rackspace_Files_Object

Get all the objects of a container

getObjects(string $container, array $options = array()) : boolean | \Zend_Service_Rackspace_Files_ObjectList

Returns a maximum of 10,000 object names.

Parameters

$container

string

$options

array

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean\Zend_Service_Rackspace_Files_ObjectList

Get whether we're using ServiceNet

getServiceNet() : boolean
Inherited

Returns

boolean

Return the size in bytes of all the containers

getSizeContainers() : integer

Returns

integer

Get the storage URL

getStorageUrl() : string | boolean
Inherited

Returns

stringboolean

Get the authentication token

getToken() : string
Inherited

Returns

string

Get User account

getUser() : string
Inherited

Returns

string

Return true is the last call was successful

isSuccessful() : boolean
Inherited

Returns

boolean

Set the Authentication URL

setAuthUrl(string $url) : void
Inherited

Parameters

$url

string

Set the authentication key

setKey(string $key) : void
Inherited

Parameters

$key

string

Set the metadata of a object in a container The old metadata values are replaced with the new one

setMetadataObject(string $container, string $object, array $metadata) : boolean

Parameters

$container

string

$object

string

$metadata

array

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean

Sets whether to use ServiceNet

setServiceNet(boolean $useServiceNet = true
Inherited

ServiceNet is Rackspace's internal network. Bandwidth on ServiceNet is not charged.

Parameters

$useServiceNet

boolean

Set the user account

setUser(string $user) : void
Inherited

Parameters

$user

string

Store a file in a container

storeObject(string $container, string $object, string $content, array $metadata = array(), string $content_type = null) : boolean

Parameters

$container

string

$object

string

$content

string

$metadata

array

$content_type

string

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean

Update the attribute of a CDN container

updateCdnContainer(string $container, integer $ttl = null, boolean $cdn_enabled = null, boolean $log = null) : boolean

Parameters

$container

string

$ttl

integer

$cdn_enabled

boolean

$log

boolean

Exceptions

\Zend_Service_Rackspace_Exception

Returns

boolean

HTTP call

httpCall(string $url, string $method, array $headers = array(), $data = array(), string $body = null) : \Zend_Http_Response
Inherited

Parameters

$url

string

$method

string

$headers

array

$data

$body

string

Returns

\Zend_Http_Response

 Properties

 

Authentication URL

$authUrl : string

Default

 

CDN URL

$cdnUrl : string

Default

 

HTTP error code

$errorCode : string

Default

 

Error Msg

$errorMsg : string

Default

 

$httpClient

$httpClient : \Zend_Http_Client

Default

 

Rackspace Key

$key : string

Default

 

Server management URL

$managementUrl : string

Default

 

Storage URL

$storageUrl : string

Default

 

Token of authentication

$token : string

Default

 

Do we use ServiceNet?

$useServiceNet : boolean

Default

false
 

Rackspace account name

$user : string

Default

 Constants

       

API_FORMAT

API_FORMAT = 'json' 
 

AUTHKEY_HEADER

AUTHKEY_HEADER = "X-Auth-Key" 
 

AUTHKEY_HEADER_LEGACY

AUTHKEY_HEADER_LEGACY = "X-Storage-Pass" 
 

AUTHTOKEN

AUTHTOKEN = "X-Auth-Token" 
 

AUTHTOKEN_LEGACY

AUTHTOKEN_LEGACY = "X-Storage-Token" 
 

AUTHUSER_HEADER

AUTHUSER_HEADER = "X-Auth-User" 
 

AUTHUSER_HEADER_LEGACY

AUTHUSER_HEADER_LEGACY = "X-Storage-User" 
 

CDNM_URL

CDNM_URL = "X-CDN-Management-Url" 
 

CDN_ACL_REFERRER

CDN_ACL_REFERRER = "X-Referrer-ACL" 
 

CDN_ACL_USER_AGENT

CDN_ACL_USER_AGENT = "X-User-Agent-ACL" 
 

CDN_EMAIL

CDN_EMAIL = "X-Purge-Email" 
 

CDN_ENABLED

CDN_ENABLED = "X-CDN-Enabled" 
 

CDN_LOG_RETENTION

CDN_LOG_RETENTION = "X-Log-Retention" 
 

CDN_SSL_URI

CDN_SSL_URI = "X-CDN-SSL-URI" 
 

CDN_TTL

CDN_TTL = "X-TTL" 
 

CDN_TTL_MAX

CDN_TTL_MAX = 1577836800 
 

CDN_TTL_MIN

CDN_TTL_MIN = 900 
 

CDN_URI

CDN_URI = "X-CDN-URI" 
 

CONTAINER_BYTES_USE

CONTAINER_BYTES_USE = "X-Container-Bytes-Used" 
 

CONTAINER_OBJ_COUNT

CONTAINER_OBJ_COUNT = "X-Container-Object-Count" 
 

ERROR_CDN_TTL_OUT_OF_RANGE

ERROR_CDN_TTL_OUT_OF_RANGE = 'TTL must be a number in seconds, min is 900 sec and maximum is 1577836800 (50 years)' 
 

ERROR_CONTAINER_EXIST

ERROR_CONTAINER_EXIST = 'The container already exists' 
 

ERROR_CONTAINER_NOT_EMPTY

ERROR_CONTAINER_NOT_EMPTY = 'The container is not empty, I cannot delete it.' 
 

ERROR_CONTAINER_NOT_FOUND

ERROR_CONTAINER_NOT_FOUND = 'The container was not found.' 
 

ERROR_OBJECT_CHECKSUM

ERROR_OBJECT_CHECKSUM = 'Checksum of the file content failed' 
 

ERROR_OBJECT_MISSING_PARAM

ERROR_OBJECT_MISSING_PARAM = 'Missing Content-Length or Content-Type header in the request' 
 

ERROR_OBJECT_NOT_FOUND

ERROR_OBJECT_NOT_FOUND = 'The object was not found.' 
 

ERROR_PARAM_NO_CONTENT

ERROR_PARAM_NO_CONTENT = 'You must specify the content of the object' 
   

ERROR_PARAM_NO_NAME_CONTAINER

ERROR_PARAM_NO_NAME_CONTAINER = 'You must specify the container name' 
 

ERROR_PARAM_NO_NAME_DEST_CONTAINER

ERROR_PARAM_NO_NAME_DEST_CONTAINER = 'You must specify the destination container name' 
 

ERROR_PARAM_NO_NAME_DEST_OBJECT

ERROR_PARAM_NO_NAME_DEST_OBJECT = 'You must specify the destination object name' 
 

ERROR_PARAM_NO_NAME_OBJECT

ERROR_PARAM_NO_NAME_OBJECT = 'You must specify the object name' 
 

ERROR_PARAM_NO_NAME_SOURCE_CONTAINER

ERROR_PARAM_NO_NAME_SOURCE_CONTAINER = 'You must specify the source container name' 
 

ERROR_PARAM_NO_NAME_SOURCE_OBJECT

ERROR_PARAM_NO_NAME_SOURCE_OBJECT = 'You must specify the source object name' 
 

ERROR_PARAM_UPDATE_CDN

ERROR_PARAM_UPDATE_CDN = 'You must specify at least one the parameters: ttl, cdn_enabled or log_retention' 
 

HEADER_CONTENT_LENGTH

HEADER_CONTENT_LENGTH = 'Content-Length' 
 

HEADER_CONTENT_TYPE

HEADER_CONTENT_TYPE = 'Content-Type' 
 

HEADER_COPY_FROM

HEADER_COPY_FROM = 'X-Copy-From' 
 

HEADER_HASH

HEADER_HASH = 'Etag' 
 

HEADER_LAST_MODIFIED

HEADER_LAST_MODIFIED = 'Last-Modified' 
 

MANAGEMENT_URL

MANAGEMENT_URL = "X-Server-Management-Url" 
 

MANIFEST_OBJECT_HEADER

MANIFEST_OBJECT_HEADER = "X-Object-Manifest" 
     

STORAGE_URL

STORAGE_URL = "X-Storage-Url" 
 

UK_AUTH_URL

UK_AUTH_URL = 'https://lon.auth.api.rackspacecloud.com' 
 

USER_AGENT

USER_AGENT = 'Zend_Service_Rackspace' 
 

US_AUTH_URL

US_AUTH_URL = 'https://auth.api.rackspacecloud.com' 
 

VERSION

VERSION = 'v1.0'