Changes the storage redundancy for an existing object.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the bucket to use. |
|
|
Required |
The file name for the object. |
|
|
Required |
The storage setting to apply to the object. [Allowed values: |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Change the preferred storage redundancy.
// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $csr = $s3->change_storage_redundancy($bucket, 'test1.txt', AmazonS3::STORAGE_REDUCED); sleep(5); $metadata = $s3->get_object_metadata($bucket, 'test1.txt'); // Success? var_dump($csr->isOK()); var_dump($metadata['StorageClass']);Result:
bool(true) string(18) "REDUCED_REDUNDANCY"
Source
Method defined in services/s3.class.php | Toggle source view (27 lines) | View on GitHub