Service/Rackspace/Files.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Rackspace  

\Zend_Service_Rackspace_Files

Package: Default
Parent(s)
\Zend_Service_Rackspace_Abstract

Constants

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

Properties

>VPropertyprotectedstring $authUrl
inherited
Authentication URL
Inherited from: \Zend_Service_Rackspace_Abstract::$$authUrl
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$authUrl  
>VPropertyprotectedstring $cdnUrl
inherited
CDN URL
Inherited from: \Zend_Service_Rackspace_Abstract::$$cdnUrl
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$cdnUrl  
>VPropertyprotectedstring $errorCode
inherited
HTTP error code
Inherited from: \Zend_Service_Rackspace_Abstract::$$errorCode
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$errorCode  
>VPropertyprotectedstring $errorMsg
inherited
Error Msg
Inherited from: \Zend_Service_Rackspace_Abstract::$$errorMsg
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$errorMsg  
>VPropertyprotected\Zend_Http_Client $httpClient
>VPropertyprotectedstring $key
inherited
Rackspace Key
Inherited from: \Zend_Service_Rackspace_Abstract::$$key
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$key  
>VPropertyprotectedstring $managementUrl
inherited
Server management URL
Inherited from: \Zend_Service_Rackspace_Abstract::$$managementUrl
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$managementUrl  
>VPropertyprotectedstring $storageUrl
inherited
Storage URL
Inherited from: \Zend_Service_Rackspace_Abstract::$$storageUrl
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$storageUrl  
>VPropertyprotectedstring $token
inherited
Token of authentication
Inherited from: \Zend_Service_Rackspace_Abstract::$$token
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$token  
>VPropertyprotectedboolean $useServiceNet = false
inherited
Do we use ServiceNet?
Inherited from: \Zend_Service_Rackspace_Abstract::$$useServiceNet
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Service_Rackspace_Abstract::$$useServiceNet  
>VPropertyprotectedstring $user
inherited
Rackspace account name
Inherited from: \Zend_Service_Rackspace_Abstract::$$user
Details
Type
string
Inherited_from
\Zend_Service_Rackspace_Abstract::$$user  

Methods

methodpublic__construct(string $user, string $key, string $authUrl = self::US_AUTH_URL) : void
inherited

Constructor

Inherited from: \Zend_Service_Rackspace_Abstract::__construct()

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

Parameters
NameTypeDescription
$userstring
$keystring
$authUrlstring
methodpublicauthenticate() : boolean
inherited

Authentication

Inherited from: \Zend_Service_Rackspace_Abstract::authenticate()
Returns
TypeDescription
boolean
methodpubliccopyObject(string $container_source, string $obj_source, string $container_dest, string $obj_dest, array $metadata = array(), string $content_type = null) : boolean

Copy an object from a container to another

Parameters
NameTypeDescription
$container_sourcestring
$obj_sourcestring
$container_deststring
$obj_deststring
$metadataarray
$content_typestring
Returns
TypeDescription
boolean
methodpubliccreateContainer(string $container, array $metadata = array()) : \Zend_Service_Rackspace_Files_Container | boolean

Create a container

Parameters
NameTypeDescription
$containerstring
$metadataarray
Returns
TypeDescription
\Zend_Service_Rackspace_Files_Container | boolean
methodpublicdeleteContainer(\sting $container) : boolean

Delete a container (only if it's empty)

Parameters
NameTypeDescription
$container\sting
Returns
TypeDescription
boolean
methodpublicdeleteObject(string $container, string $object) : boolean

Delete an object in a container

Parameters
NameTypeDescription
$containerstring
$objectstring
Returns
TypeDescription
boolean
methodpublicenableCdnContainer(string $container, integer $ttl = self::CDN_TTL_MIN) : array | boolean

Enable the CDN for a container

Parameters
NameTypeDescription
$containerstring
$ttlinteger
Returns
TypeDescription
array | boolean
methodpublicgetAuthUrl() : string
inherited

Get authentication URL

Inherited from: \Zend_Service_Rackspace_Abstract::getAuthUrl()
Returns
TypeDescription
string
methodpublicgetCdnContainers(array $options = array()) : array | boolean

Get all the CDN containers

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
array | boolean
methodpublicgetCdnUrl() : string | boolean
inherited

Get the CDN URL

Inherited from: \Zend_Service_Rackspace_Abstract::getCdnUrl()
Returns
TypeDescription
string | boolean
methodpublicgetContainer(string $container) : \Container | boolean

Get a container

Parameters
NameTypeDescription
$containerstring
Returns
TypeDescription
\Container | boolean
methodpublicgetContainers(array $options = array()) : \Zend_Service_Rackspace_Files_ContainerList | boolean

Get all the containers

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Service_Rackspace_Files_ContainerList | boolean
methodpublicgetCountContainers() : integer

Return the total count of containers

Returns
TypeDescription
integer
methodpublicgetCountObjects() : integer

Return the count of objects contained in all the containers

Returns
TypeDescription
integer
methodpublicgetErrorCode() : \strig
inherited

Get the error code of the last HTTP call

Inherited from: \Zend_Service_Rackspace_Abstract::getErrorCode()
Returns
TypeDescription
\strig
methodpublicgetErrorMsg() : string
inherited

Get the error msg of the last HTTP call

Inherited from: \Zend_Service_Rackspace_Abstract::getErrorMsg()
Returns
TypeDescription
string
methodpublicgetHttpClient() : \Zend_Http_Client
inherited

get the HttpClient instance

Inherited from: \Zend_Service_Rackspace_Abstract::getHttpClient()
Returns
TypeDescription
\Zend_Http_Client
methodpublicgetInfoAccount() : array | boolean

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

Returns
TypeDescription
array | boolean
methodpublicgetInfoCdnContainer(string $container) : array | boolean

Get the information of a Cdn container

Parameters
NameTypeDescription
$containerstring
Returns
TypeDescription
array | boolean
methodpublicgetKey() : string
inherited

Get user key

Inherited from: \Zend_Service_Rackspace_Abstract::getKey()
Returns
TypeDescription
string
methodpublicgetManagementUrl() : string | boolean
inherited

Get the management server URL

Inherited from: \Zend_Service_Rackspace_Abstract::getManagementUrl()
Returns
TypeDescription
string | boolean
methodpublicgetMetadataContainer(string $container) : array | boolean

Get the metadata of a container

Parameters
NameTypeDescription
$containerstring
Returns
TypeDescription
array | boolean
methodpublicgetMetadataObject(string $container, string $object) : array | boolean

Get the metadata of an object

Parameters
NameTypeDescription
$containerstring
$objectstring
Returns
TypeDescription
array | boolean
methodpublicgetObject(string $container, string $object, array $headers = array()) : \Zend_Service_Rackspace_Files_Object | boolean

Get an object in a container

Parameters
NameTypeDescription
$containerstring
$objectstring
$headersarray
Returns
TypeDescription
\Zend_Service_Rackspace_Files_Object | boolean
methodpublicgetObjects(string $container, array $options = array()) : \Zend_Service_Rackspace_Files_ObjectList | boolean

Get all the objects of a container

Parameters
NameTypeDescription
$containerstring
$optionsarray
Returns
TypeDescription
\Zend_Service_Rackspace_Files_ObjectList | boolean
methodpublicgetServiceNet() : boolean
inherited

Get whether we're using ServiceNet

Inherited from: \Zend_Service_Rackspace_Abstract::getServiceNet()
Returns
TypeDescription
boolean
methodpublicgetSizeContainers() : integer

Return the size in bytes of all the containers

Returns
TypeDescription
integer
methodpublicgetStorageUrl() : string | boolean
inherited

Get the storage URL

Inherited from: \Zend_Service_Rackspace_Abstract::getStorageUrl()
Returns
TypeDescription
string | boolean
methodpublicgetToken() : string
inherited

Get the authentication token

Inherited from: \Zend_Service_Rackspace_Abstract::getToken()
Returns
TypeDescription
string
methodpublicgetUser() : string
inherited

Get User account

Inherited from: \Zend_Service_Rackspace_Abstract::getUser()
Returns
TypeDescription
string
methodprotectedhttpCall(string $url, string $method, array $headers = array(),  $data = array(), string $body = null) : \Zend_Http_Response
inherited

HTTP call

Inherited from: \Zend_Service_Rackspace_Abstract::httpCall()
Parameters
NameTypeDescription
$urlstring
$methodstring
$headersarray
$data
$bodystring
Returns
TypeDescription
\Zend_Http_Response
methodpublicisSuccessful() : boolean
inherited

Return true is the last call was successful

Inherited from: \Zend_Service_Rackspace_Abstract::isSuccessful()
Returns
TypeDescription
boolean
methodpublicsetAuthUrl(string $url) : void
inherited

Set the Authentication URL

Inherited from: \Zend_Service_Rackspace_Abstract::setAuthUrl()
Parameters
NameTypeDescription
$urlstring
methodpublicsetKey(string $key) : void
inherited

Set the authentication key

Inherited from: \Zend_Service_Rackspace_Abstract::setKey()
Parameters
NameTypeDescription
$keystring
methodpublicsetMetadataObject(string $container, string $object, array $metadata) : boolean

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

Parameters
NameTypeDescription
$containerstring
$objectstring
$metadataarray
Returns
TypeDescription
boolean
methodpublicsetServiceNet(boolean $useServiceNet = true) : void
inherited

Sets whether to use ServiceNet

Inherited from: \Zend_Service_Rackspace_Abstract::setServiceNet()

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

Parameters
NameTypeDescription
$useServiceNetboolean
methodpublicsetUser(string $user) : void
inherited

Set the user account

Inherited from: \Zend_Service_Rackspace_Abstract::setUser()
Parameters
NameTypeDescription
$userstring
methodpublicstoreObject(string $container, string $object, string $content, array $metadata = array(), string $content_type = null) : boolean

Store a file in a container

Parameters
NameTypeDescription
$containerstring
$objectstring
$contentstring
$metadataarray
$content_typestring
Returns
TypeDescription
boolean
methodpublicupdateCdnContainer(string $container, integer $ttl = null, boolean $cdn_enabled = null, boolean $log = null) : boolean

Update the attribute of a CDN container

Parameters
NameTypeDescription
$containerstring
$ttlinteger
$cdn_enabledboolean
$logboolean
Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.0.0a12.