compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (20)

View Page History
[Justin Plock|mailto:jplock@gmail.com]
[Alexander Veremyev|mailto:alexander.v@zend.com] (Zend liaison)
[Stanislav Malyshev|mailto:stas@zend.com]
{zone-data}

1.0 - 10 March 2008: Initial revision.
1.1 - 31 December 2008: Revised code committed into laboratory SVN
2.0 - 25 February 2009: Revised the API and finalized the laboratory implementation
{zone-data}

{zone-data:overview}
Zend_Service_Amazon_S3 is an implementation of a the service API and PHP user-stream wrapper for Amazon's Simple Storage Service (S3)
{zone-data}

* This component *will* implement the Amazon S3 API
* This component *will* use Zend_Http_Client to communicate with S3
* This component *will* provide the API to use Amazon S3 directly
* This component *will* implement a user-based stream wrapper for S3 (s3://)
* This component *will* allow using multiple S3 accounts
{zone-data}


{zone-data:operation}
This component will provide Amazon S3 API allowing to store and retrieve data from the Amazon S3 service.

This Also, this component will be utilized using the stream_wrapper_register() PHP method to register a new user-based stream interface to S3. This allows the user to utilize existing fread(), fwrite(), fclose(), mkdir(), rmdir(), and stat() methods to directly interface with S3 buckets and objects.
{zone-data}

{zone-data:milestones}
* Milestone 1: \[DONE\] Design notes will be published here
* Milestone 2: \[DONE\] Working prototype checked into the incubator laboratory supporting use cases
* Milestone 3: \[DONE\] Unit tests exist, work, and are checked into SVN.
* Milestone 4: \[DONE\] Initial documentation exists.
* Milestone 5: Proposal accepted and moved to incubator
* Milestone 6: The component is accepted as part of ZF core
{zone-data}

{zone-data:class-list}
* Zend_Service_Amazon_S3
* Zend_Service_Amazon_S3_Stream
{zone-data}

{zone-data:use-cases}
||UC-01 Direct API ||
{code}
require_once 'Zend/Service/Amazon/S3.php';

define('AWS_ACCESS_KEY', 'my-access-key');
define('AWS_SECRET_KEY', 'my-secret-key');

Zend_Service_Amazon_S3::setKeys(AWS_ACCESS_KEY, AWS_SECRET_KEY);
$s3 = new Zend_Service_Amazon_S3(AWS_ACCESS_KEY, AWS_SECRET_KEY);

if (!stream_wrapper_register('s3', 'Zend_Service_Amazon_S3')) {
echo 'Could not register S3 stream';
exit(0); $s3->createBucket("my-own-bucket");
}

$s3->putObject("my-own-bucket/myobject", "somedata");

echo $s3->getObject("my-own-bucket/myobject");
{code}
||UC-02 streams example||
{code}
<?php
require_once 'Zend/Service/Amazon/S3.php';

define('AWS_ACCESS_KEY', 'my-access-key');
define('AWS_SECRET_KEY', 'my-secret-key');

$s3 = new Zend_Service_Amazon_S3(AWS_ACCESS_KEY, AWS_SECRET_KEY);

$s3->registerStreamWrapper("s3");

mkdir("s3://my-own-bucket");
file_put_contents("s3://my-own-bucket/testdata", "mydata");

echo file_get_contents("s3://my-own-bucket/testdata");


{code}
||UC-03 extended streams example||
{code}
require_once 'Zend/Service/Amazon/S3.php';

define('AWS_ACCESS_KEY', 'my-access-key');
define('AWS_SECRET_KEY', 'my-secret-key');

$s3 = new Zend_Service_Amazon_S3(AWS_ACCESS_KEY, AWS_SECRET_KEY);

mkdir('s3://php-test');