Service/Rackspace/Files.php
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 [email protected] 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
- Parent(s)
- \Zend_Service_Rackspace_Abstract
Constants

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

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

VERSION
= 'v1.0'
- Inherited_from
- \Zend_Service_Rackspace_Abstract::VERSION

US_AUTH_URL
= 'https://auth.api.rackspacecloud.com'
- Inherited_from
- \Zend_Service_Rackspace_Abstract::US_AUTH_URL

UK_AUTH_URL
= 'https://lon.auth.api.rackspacecloud.com'
- Inherited_from
- \Zend_Service_Rackspace_Abstract::UK_AUTH_URL

API_FORMAT
= 'json'
- Inherited_from
- \Zend_Service_Rackspace_Abstract::API_FORMAT

USER_AGENT
= 'Zend_Service_Rackspace'
- Inherited_from
- \Zend_Service_Rackspace_Abstract::USER_AGENT

STORAGE_URL
= "X-Storage-Url"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::STORAGE_URL

AUTHTOKEN
= "X-Auth-Token"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::AUTHTOKEN

AUTHUSER_HEADER
= "X-Auth-User"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::AUTHUSER_HEADER

AUTHKEY_HEADER
= "X-Auth-Key"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::AUTHKEY_HEADER

AUTHUSER_HEADER_LEGACY
= "X-Storage-User"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::AUTHUSER_HEADER_LEGACY

AUTHKEY_HEADER_LEGACY
= "X-Storage-Pass"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::AUTHKEY_HEADER_LEGACY

AUTHTOKEN_LEGACY
= "X-Storage-Token"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::AUTHTOKEN_LEGACY

CDNM_URL
= "X-CDN-Management-Url"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::CDNM_URL

MANAGEMENT_URL
= "X-Server-Management-Url"
- Inherited_from
- \Zend_Service_Rackspace_Abstract::MANAGEMENT_URL
Properties


string $errorCode =
- Type
- string
- Inherited_from
- \Zend_Service_Rackspace_Abstract::$$errorCode


\Zend_Http_Client $httpClient =
- Type
- \Zend_Http_Client
- Inherited_from
- \Zend_Service_Rackspace_Abstract::$$httpClient


string $managementUrl =
- Type
- string
- Inherited_from
- \Zend_Service_Rackspace_Abstract::$$managementUrl


string $storageUrl =
- Type
- string
- Inherited_from
- \Zend_Service_Rackspace_Abstract::$$storageUrl


boolean $useServiceNet = false
false
Details- Type
- boolean
- Inherited_from
- \Zend_Service_Rackspace_Abstract::$$useServiceNet
Methods


__construct(string $user, string $key, string $authUrl = self::US_AUTH_URL) : void
You must pass the account and the Rackspace authentication key. Optional: the authentication url (default is US)
Name | Type | Description |
---|---|---|
$user | string | |
$key | string | |
$authUrl | string |


copyObject(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
Name | Type | Description |
---|---|---|
$container_source | string | |
$obj_source | string | |
$container_dest | string | |
$obj_dest | string | |
$metadata | array | |
$content_type | string |
Type | Description |
---|---|
boolean |


createContainer(string $container, array $metadata = array()) : \Zend_Service_Rackspace_Files_Container | boolean
Create a container
Name | Type | Description |
---|---|---|
$container | string | |
$metadata | array |
Type | Description |
---|---|
\Zend_Service_Rackspace_Files_Container | boolean |


deleteContainer(\sting $container) : boolean
Delete a container (only if it's empty)
Name | Type | Description |
---|---|---|
$container | \sting |
Type | Description |
---|---|
boolean |


deleteObject(string $container, string $object) : boolean
Delete an object in a container
Name | Type | Description |
---|---|---|
$container | string | |
$object | string |
Type | Description |
---|---|
boolean |


enableCdnContainer(string $container, integer $ttl = self::CDN_TTL_MIN) : array | boolean
Enable the CDN for a container
Name | Type | Description |
---|---|---|
$container | string | |
$ttl | integer |
Type | Description |
---|---|
array | boolean |


getCdnContainers(array $options = array()) : array | boolean
Get all the CDN containers
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
array | boolean |


getContainer(string $container) : \Container | boolean
Get a container
Name | Type | Description |
---|---|---|
$container | string |
Type | Description |
---|---|
\Container | boolean |


getContainers(array $options = array()) : \Zend_Service_Rackspace_Files_ContainerList | boolean
Get all the containers
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_Service_Rackspace_Files_ContainerList | boolean |


getCountObjects() : integer
Return the count of objects contained in all the containers
Type | Description |
---|---|
integer |


getErrorCode() : \strig
Get the error code of the last HTTP call
Inherited from: \Zend_Service_Rackspace_Abstract::getErrorCode()Type | Description |
---|---|
\strig |


getErrorMsg() : string
Get the error msg of the last HTTP call
Inherited from: \Zend_Service_Rackspace_Abstract::getErrorMsg()Type | Description |
---|---|
string |


getHttpClient() : \Zend_Http_Client
get the HttpClient instance
Inherited from: \Zend_Service_Rackspace_Abstract::getHttpClient()Type | Description |
---|---|
\Zend_Http_Client |


getInfoAccount() : 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
Type | Description |
---|---|
array | boolean |


getInfoCdnContainer(string $container) : array | boolean
Get the information of a Cdn container
Name | Type | Description |
---|---|---|
$container | string |
Type | Description |
---|---|
array | boolean |


getManagementUrl() : string | boolean
Get the management server URL
Inherited from: \Zend_Service_Rackspace_Abstract::getManagementUrl()Type | Description |
---|---|
string | boolean |


getMetadataContainer(string $container) : array | boolean
Get the metadata of a container
Name | Type | Description |
---|---|---|
$container | string |
Type | Description |
---|---|
array | boolean |


getMetadataObject(string $container, string $object) : array | boolean
Get the metadata of an object
Name | Type | Description |
---|---|---|
$container | string | |
$object | string |
Type | Description |
---|---|
array | boolean |


getObject(string $container, string $object, array $headers = array()) : \Zend_Service_Rackspace_Files_Object | boolean
Get an object in a container
Name | Type | Description |
---|---|---|
$container | string | |
$object | string | |
$headers | array |
Type | Description |
---|---|
\Zend_Service_Rackspace_Files_Object | boolean |


getObjects(string $container, array $options = array()) : \Zend_Service_Rackspace_Files_ObjectList | boolean
Get all the objects of a container
Name | Type | Description |
---|---|---|
$container | string | |
$options | array |
Type | Description |
---|---|
\Zend_Service_Rackspace_Files_ObjectList | boolean |


getServiceNet() : boolean
Get whether we're using ServiceNet
Inherited from: \Zend_Service_Rackspace_Abstract::getServiceNet()Type | Description |
---|---|
boolean |


getSizeContainers() : integer
Return the size in bytes of all the containers
Type | Description |
---|---|
integer |


httpCall(string $url, string $method, array $headers = array(), $data = array(), string $body = null) : \Zend_Http_Response
Name | Type | Description |
---|---|---|
$url | string | |
$method | string | |
$headers | array | |
$data | ||
$body | string |
Type | Description |
---|---|
\Zend_Http_Response |


isSuccessful() : boolean
Return true is the last call was successful
Inherited from: \Zend_Service_Rackspace_Abstract::isSuccessful()Type | Description |
---|---|
boolean |


setMetadataObject(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
Name | Type | Description |
---|---|---|
$container | string | |
$object | string | |
$metadata | array |
Type | Description |
---|---|
boolean |


setServiceNet(boolean $useServiceNet = true) : void
Sets whether to use ServiceNet
Inherited from: \Zend_Service_Rackspace_Abstract::setServiceNet()ServiceNet is Rackspace's internal network. Bandwidth on ServiceNet is not charged.
Name | Type | Description |
---|---|---|
$useServiceNet | boolean |


storeObject(string $container, string $object, string $content, array $metadata = array(), string $content_type = null) : boolean
Store a file in a container
Name | Type | Description |
---|---|---|
$container | string | |
$object | string | |
$content | string | |
$metadata | array | |
$content_type | string |
Type | Description |
---|---|
boolean |