The interface Zend_Cloud_StorageService_Adapter defines methods
that each concrete storage service adapter must implement. The following adapters are
shipped with the Simple Cloud API:
Zend_Cloud_StorageService_Adapter_FileSystem
To create the service object, call the static method
Zend_Cloud_StorageService_Factory::getAdapter(), which accepts
either an array or a Zend_Config object. The key named
storage_adapter should specify the concrete adapter class.
Adapter-specific keys may also be passed in this configuration parameter.
Example 95. Using the StorageService Factory
<?php
$storage = Zend_Cloud_StorageService_Factory::getAdapter(array(
Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY => 'Zend_Cloud_StorageService_Adapter_S3',
Zend_Cloud_StorageService_Adapter_S3::AWS_ACCESS_KEY => $amazonKey,
Zend_Cloud_StorageService_Adapter_S3::AWS_SECRET_KEY => $amazonSecret,
));
Table 38. Zend_Cloud_StorageService_Adapter_S3 options
| Option key | Description | Used in | Required | Default |
|---|---|---|---|---|
| aws_accesskey | Amazon AWS access key | Constructor | Yes | None |
| aws_secretkey | Amazon AWS secret key | Constructor | Yes | None |
| bucket_name | The name of the S3 bucket for this item | Used in the constructor to set the default bucket for the instantiated service. This option can also be specified in any of the item access operations. | Yes | None |
| bucket_as_domain | Indicates that the bucket name is part of the domain name | Used in constructor to set the default behavior for the instantiated service. This option can also be specified in any of the item access operations. | No | False |
| metadata | Array of metadata to associate with the item | storeItem() |
No | None |
| fetch_stream |
Indicates whether the response is stream, and not a string
Note
See the |
fetchItem() |
No | False |
| http_adapter | HTTP adapter to use in all access operations | Constructor | No | Zend_Http_Client_Adapter_Socket |
Table 39. Zend_Cloud_StorageService_Adapter_WindowsAzure options
| Option key | Description | Used in | Required | Default |
|---|---|---|---|---|
| storage_accountname | Windows Azure account name | Constructor | Yes | None |
| storage_accountkey | Windows Azure account key | Constructor | Yes | None |
| storage_container | Container to use for this storage object | Constructor | Yes | None |
| storage_host | Windows Azure access host | Constructor | Yes | blob.core.windows.net |
| storage_proxy_host | Proxy hostname | Constructor | No | None |
| storage_proxy_port | Proxy port | Constructor | No | 8080 |
| storage_proxy_credentials | Proxy credentials | Constructor | No | None |
| http_adapter | HTTP adapter to use in all access operations | Constructor | No | Zend_Http_Client_Adapter_Socket |
| returntype |
How to return the results.
|
fetchItem(),
listItems()
|
No |
RETURN_STREAM for
fetchItem();
RETURN_NAMES for
listItems()
|
| return_path | Return path. This is the URL that can be used to access the item after it has been uploaded. | fetchItem() |
No | System tmp directory |
| return_openmode |
fopen() mode used to open the file for
saving data
|
fetchItem() |
No | 'r' |
Table 40. Zend_Cloud_StorageService_Adapter_Nirvanix options
| Option key | Description | Used in | Required | Default |
|---|---|---|---|---|
| auth_username | Nirvanix user name | Constructor | Yes | None |
| auth_password | Nirvanix password | Constructor | Yes | None |
| auth_accesskey | Nirvanix access key | Constructor | Yes | None |
| http_adapter | HTTP adapter to use in all access operations | Constructor | No | Zend_Http_Client_Adapter_Socket |
| remote_directory | Nirvanix directory to use | Constructor (mandatory) | Yes | None |
Table 41. Zend_Cloud_StorageService_Adapter_Filesystem options
| Option key | Description | Used in | Required | Default |
|---|---|---|---|---|
| local_directory | Local directory where the files will be stored | Constructor | No | System tmp directory |




