Zend Framework  1.12
Public Member Functions | Public Attributes | List of all members
Zend_Service_Rackspace_Files Class Reference

Public Member Functions

 getCountContainers ()
 Return the total count of containers.
 
 getSizeContainers ()
 Return the size in bytes of all the containers.
 
 getCountObjects ()
 Return the count of objects contained in all the containers.
 
 getContainers ($options=array())
 Get all the containers.
 
 getCdnContainers ($options=array())
 Get all the CDN containers.
 
 getInfoAccount ()
 Get the metadata information of the accounts:
 
 getObjects ($container, $options=array())
 Get all the objects of a container.
 
 createContainer ($container, $metadata=array())
 Create a container.
 
 deleteContainer ($container)
 Delete a container (only if it's empty)
 
 getMetadataContainer ($container)
 Get the metadata of a container.
 
 getContainer ($container)
 Get a container.
 
 getObject ($container, $object, $headers=array())
 Get an object in a container.
 
 storeObject ($container, $object, $content, $metadata=array(), $content_type=null)
 Store a file in a container.
 
 deleteObject ($container, $object)
 Delete an object in a container.
 
 copyObject ($container_source, $obj_source, $container_dest, $obj_dest, $metadata=array(), $content_type=null)
 Copy an object from a container to another.
 
 getMetadataObject ($container, $object)
 Get the metadata of an object.
 
 setMetadataObject ($container, $object, $metadata)
 Set the metadata of a object in a container The old metadata values are replaced with the new one.
 
 enableCdnContainer ($container, $ttl=self::CDN_TTL_MIN)
 Enable the CDN for a container.
 
 updateCdnContainer ($container, $ttl=null, $cdn_enabled=null, $log=null)
 Update the attribute of a CDN container.
 
 getInfoCdnContainer ($container)
 Get the information of a Cdn container.
 
- Public Member Functions inherited from Zend_Service_Rackspace_Abstract
 __construct ($user, $key, $authUrl=self::US_AUTH_URL)
 Constructor.
 
 getUser ()
 Get User account.
 
 getKey ()
 Get user key.
 
 getAuthUrl ()
 Get authentication URL.
 
 getStorageUrl ()
 Get the storage URL.
 
 getCdnUrl ()
 Get the CDN URL.
 
 getManagementUrl ()
 Get the management server URL.
 
 setUser ($user)
 Set the user account.
 
 setKey ($key)
 Set the authentication key.
 
 setAuthUrl ($url)
 Set the Authentication URL.
 
 setServiceNet ($useServiceNet=true)
 Sets whether to use ServiceNet.
 
 getServiceNet ()
 Get whether we're using ServiceNet.
 
 getToken ()
 Get the authentication token.
 
 getErrorMsg ()
 Get the error msg of the last HTTP call.
 
 getErrorCode ()
 Get the error code of the last HTTP call.
 
 getHttpClient ()
 get the HttpClient instance
 
 isSuccessful ()
 Return true is the last call was successful.
 
 authenticate ()
 Authentication.
 

Public Attributes

const ERROR_CONTAINER_NOT_EMPTY = 'The container is not empty, I cannot delete it.'
 
const ERROR_CONTAINER_NOT_FOUND = 'The container was not found.'
 
const ERROR_OBJECT_NOT_FOUND = 'The object was not found.'
 
const ERROR_OBJECT_MISSING_PARAM = 'Missing Content-Length or Content-Type header in the request'
 
const ERROR_OBJECT_CHECKSUM = 'Checksum of the file content failed'
 
const ERROR_CONTAINER_EXIST = 'The container already exists'
 
const ERROR_PARAM_NO_NAME_CONTAINER = 'You must specify the container name'
 
const ERROR_PARAM_NO_NAME_OBJECT = 'You must specify the object name'
 
const ERROR_PARAM_NO_CONTENT = 'You must specify the content of the object'
 
const ERROR_PARAM_NO_NAME_SOURCE_CONTAINER = 'You must specify the source container name'
 
const ERROR_PARAM_NO_NAME_SOURCE_OBJECT = 'You must specify the source object name'
 
const ERROR_PARAM_NO_NAME_DEST_CONTAINER = 'You must specify the destination container name'
 
const ERROR_PARAM_NO_NAME_DEST_OBJECT = 'You must specify the destination object name'
 
const ERROR_PARAM_NO_METADATA = 'You must specify the metadata array'
 
const ERROR_CDN_TTL_OUT_OF_RANGE = 'TTL must be a number in seconds, min is 900 sec and maximum is 1577836800 (50 years)'
 
const ERROR_PARAM_UPDATE_CDN = 'You must specify at least one the parameters: ttl, cdn_enabled or log_retention'
 
const HEADER_CONTENT_TYPE = 'Content-Type'
 
const HEADER_HASH = 'Etag'
 
const HEADER_LAST_MODIFIED = 'Last-Modified'
 
const HEADER_CONTENT_LENGTH = 'Content-Length'
 
const HEADER_COPY_FROM = 'X-Copy-From'
 
const METADATA_OBJECT_HEADER = "X-Object-Meta-"
 
const METADATA_CONTAINER_HEADER = "X-Container-Meta-"
 
const CDN_URI = "X-CDN-URI"
 
const CDN_SSL_URI = "X-CDN-SSL-URI"
 
const CDN_ENABLED = "X-CDN-Enabled"
 
const CDN_LOG_RETENTION = "X-Log-Retention"
 
const CDN_ACL_USER_AGENT = "X-User-Agent-ACL"
 
const CDN_ACL_REFERRER = "X-Referrer-ACL"
 
const CDN_TTL = "X-TTL"
 
const CDN_TTL_MIN = 900
 
const CDN_TTL_MAX = 1577836800
 
const CDN_EMAIL = "X-Purge-Email"
 
const ACCOUNT_CONTAINER_COUNT = "X-Account-Container-Count"
 
const ACCOUNT_BYTES_USED = "X-Account-Bytes-Used"
 
const ACCOUNT_OBJ_COUNT = "X-Account-Object-Count"
 
const CONTAINER_OBJ_COUNT = "X-Container-Object-Count"
 
const CONTAINER_BYTES_USE = "X-Container-Bytes-Used"
 
const MANIFEST_OBJECT_HEADER = "X-Object-Manifest"
 
- Public Attributes inherited from Zend_Service_Rackspace_Abstract
const VERSION = 'v1.0'
 
const US_AUTH_URL = 'https://auth.api.rackspacecloud.com'
 
const UK_AUTH_URL = 'https://lon.auth.api.rackspacecloud.com'
 
const API_FORMAT = 'json'
 
const USER_AGENT = 'Zend_Service_Rackspace'
 
const STORAGE_URL = "X-Storage-Url"
 
const AUTHTOKEN = "X-Auth-Token"
 
const AUTHUSER_HEADER = "X-Auth-User"
 
const AUTHKEY_HEADER = "X-Auth-Key"
 
const AUTHUSER_HEADER_LEGACY = "X-Storage-User"
 
const AUTHKEY_HEADER_LEGACY = "X-Storage-Pass"
 
const AUTHTOKEN_LEGACY = "X-Storage-Token"
 
const CDNM_URL = "X-CDN-Management-Url"
 
const MANAGEMENT_URL = "X-Server-Management-Url"
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Service_Rackspace_Abstract
 httpCall ($url, $method, $headers=array(), $data=array(), $body=null)
 HTTP call.
 
- Protected Attributes inherited from Zend_Service_Rackspace_Abstract
 $key
 
 $user
 
 $token
 
 $authUrl
 
 $httpClient
 
 $errorMsg
 
 $errorCode
 
 $storageUrl
 
 $cdnUrl
 
 $managementUrl
 
 $useServiceNet = false
 

Member Function Documentation

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

Copy an object from a container to another.

Parameters
string$container_source
string$obj_source
string$container_dest
string$obj_dest
array$metadata
string$content_type
Returns
boolean
createContainer (   $container,
  $metadata = array() 
)

Create a container.

Parameters
string$container
array$metadata
Returns
Zend_Service_Rackspace_Files_Container|boolean
deleteContainer (   $container)

Delete a container (only if it's empty)

Parameters
sting$container
Returns
boolean
deleteObject (   $container,
  $object 
)

Delete an object in a container.

Parameters
string$container
string$object
Returns
boolean
enableCdnContainer (   $container,
  $ttl = self::CDN_TTL_MIN 
)

Enable the CDN for a container.

Parameters
string$container
integer$ttl
Returns
array|boolean
getCdnContainers (   $options = array())

Get all the CDN containers.

Parameters
array$options
Returns
array|boolean
getContainer (   $container)

Get a container.

Parameters
string$container
Returns
Container|boolean
getContainers (   $options = array())

Get all the containers.

Parameters
array$options
Returns
Zend_Service_Rackspace_Files_ContainerList|boolean
getCountContainers ( )

Return the total count of containers.

Returns
integer
getCountObjects ( )

Return the count of objects contained in all the containers.

Returns
integer
getInfoAccount ( )

Get the metadata information of the accounts:

  • total count containers
  • size in bytes of all the containers
  • total objects in all the containers
Returns
array|boolean
getInfoCdnContainer (   $container)

Get the information of a Cdn container.

Parameters
string$container
Returns
array|boolean
getMetadataContainer (   $container)

Get the metadata of a container.

Parameters
string$container
Returns
array|boolean
getMetadataObject (   $container,
  $object 
)

Get the metadata of an object.

Parameters
string$container
string$object
Returns
array|boolean
getObject (   $container,
  $object,
  $headers = array() 
)

Get an object in a container.

Parameters
string$container
string$object
array$headers
Returns
Zend_Service_Rackspace_Files_Object|boolean
getObjects (   $container,
  $options = array() 
)

Get all the objects of a container.

Parameters
string$container
array$options
Returns
Zend_Service_Rackspace_Files_ObjectList|boolean
getSizeContainers ( )

Return the size in bytes of all the containers.

Returns
integer
setMetadataObject (   $container,
  $object,
  $metadata 
)

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

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

Store a file in a container.

Parameters
string$container
string$object
string$content
array$metadata
string$content_type
Returns
boolean
updateCdnContainer (   $container,
  $ttl = null,
  $cdn_enabled = null,
  $log = null 
)

Update the attribute of a CDN container.

Parameters
string$container
integer$ttl
boolean$cdn_enabled
boolean$log
Returns
boolean

Member Data Documentation

const ACCOUNT_BYTES_USED = "X-Account-Bytes-Used"
const ACCOUNT_CONTAINER_COUNT = "X-Account-Container-Count"
const ACCOUNT_OBJ_COUNT = "X-Account-Object-Count"
const CDN_ACL_REFERRER = "X-Referrer-ACL"
const CDN_ACL_USER_AGENT = "X-User-Agent-ACL"
const CDN_EMAIL = "X-Purge-Email"
const CDN_ENABLED = "X-CDN-Enabled"
const CDN_LOG_RETENTION = "X-Log-Retention"
const CDN_SSL_URI = "X-CDN-SSL-URI"
const CDN_TTL = "X-TTL"
const CDN_TTL_MAX = 1577836800
const CDN_TTL_MIN = 900
const CDN_URI = "X-CDN-URI"
const CONTAINER_BYTES_USE = "X-Container-Bytes-Used"
const CONTAINER_OBJ_COUNT = "X-Container-Object-Count"
const ERROR_CDN_TTL_OUT_OF_RANGE = 'TTL must be a number in seconds, min is 900 sec and maximum is 1577836800 (50 years)'
const ERROR_CONTAINER_EXIST = 'The container already exists'
const ERROR_CONTAINER_NOT_EMPTY = 'The container is not empty, I cannot delete it.'
const ERROR_CONTAINER_NOT_FOUND = 'The container was not found.'
const ERROR_OBJECT_CHECKSUM = 'Checksum of the file content failed'
const ERROR_OBJECT_MISSING_PARAM = 'Missing Content-Length or Content-Type header in the request'
const ERROR_OBJECT_NOT_FOUND = 'The object was not found.'
const ERROR_PARAM_NO_CONTENT = 'You must specify the content of the object'
const ERROR_PARAM_NO_METADATA = 'You must specify the metadata array'
const ERROR_PARAM_NO_NAME_CONTAINER = 'You must specify the container name'
const ERROR_PARAM_NO_NAME_DEST_CONTAINER = 'You must specify the destination container name'
const ERROR_PARAM_NO_NAME_DEST_OBJECT = 'You must specify the destination object name'
const ERROR_PARAM_NO_NAME_OBJECT = 'You must specify the object name'
const ERROR_PARAM_NO_NAME_SOURCE_CONTAINER = 'You must specify the source container name'
const ERROR_PARAM_NO_NAME_SOURCE_OBJECT = 'You must specify the source object name'
const ERROR_PARAM_UPDATE_CDN = 'You must specify at least one the parameters: ttl, cdn_enabled or log_retention'
const HEADER_CONTENT_LENGTH = 'Content-Length'
const HEADER_CONTENT_TYPE = 'Content-Type'
const HEADER_COPY_FROM = 'X-Copy-From'
const HEADER_HASH = 'Etag'
const HEADER_LAST_MODIFIED = 'Last-Modified'
const MANIFEST_OBJECT_HEADER = "X-Object-Manifest"
const METADATA_CONTAINER_HEADER = "X-Container-Meta-"
const METADATA_OBJECT_HEADER = "X-Object-Meta-"