Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Service_Amazon_S3 Component Proposal

Proposed Component Name Zend_Service_Amazon_S3
Developer Notes
Proposers Travis Swicegood
Darby Felton, Zend liaison
Revision 1.0 - April 3, 2007: Initial draft completed (wiki revision: 12)

Table of Contents

1. Overview

Zend_Service_Amazon_S3 offers a PHP API to Amazon's Simple Storage Service (S3).

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will handle connectiosn to Amazon S3
  • This component will handle creation, modification, and retrieval of S3 "buckets"
  • This component will handle creation, modification, and retrieval of S3 "objects"
  • This component will handle requests against S3's "service"
  • This component will correctly generate a proper hash required to prove authorization to Amazon S3

4. Dependencies on Other Framework Components

  • Zend_Http_Client

5. Theory of Operation

6. Milestones / Tasks

  • Milestone 1: [IN PROGRESS]Finish creating outline document
  • Milestone 2: Working code ported from Domain51_Service_Amazon_S3 to Zend_Service_Amazon_S3
  • Milestone 3: Unit tests are ported from current code into existing code
  • Milestone 4: Initial documentation exists.

7. Class Index

  • Zend_Service_Amazon_S3 (main entry point to API)
  • Zend_Service_Amazon_S3_Exception
  • Zend_Service_Amazon_S3_Bucket
  • Zend_Service_Amazon_S3_Object
  • Zend_Service_Amazon_S3_Service (possible - a list of all buckets owned by a user)
  • Zend_Service_Amazon_S3_Connection

8. Use Cases


9. Class Skeletons



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 03, 2007

    <p>Thanks for this proposal. I was thinking about writing one myself.</p>

    <p>What do you think about a possibility to handle large objects on S3? Maybe with Zend_Memory? </p>

    1. Apr 04, 2007

      <p>Define large objects. <ac:emoticon ac:name="smile" /></p>

      <p>In the projects I've used S3 one, I've always just grabbed directly from S3, and outputted or manipulated as needed. At that point I'm dealing with files that are still measured in Kb though. I believe the majority of dynamic usage is going to either be direct output (i.e., static content stored on S3) or retrieving a file to work on locally. In the latter case, I imagine most people are going to dump them into their underlying file system, then manipulate them as necessary along the lines of handling an uploaded file.</p>

      <p>As far as using Zend_Memory, I'm not opposed to it, but I'm not sure if it would be possible unless you can pipe the results of an HTTP request into Zend_Memory directly. If that's possible, it's just a matter of allowing the specification of the container that should be used for the retrieved object. In the current implementation that I've done (the Domain51_ version), it returns the raw XML from Amazon's response.</p>

      1. Apr 04, 2007

        <p>Well, let's say 100 MB? 1 GB? Or just anything larger, than a php process can handle. Normally you read the content of a file and send it to amazon, or read it from there... In a case of a big file, you should somehow stream it from/to S3 without having it all in memory.</p>

        1. Apr 04, 2007

          <p>I think the 100Mb is probably about the right area where straight PHP (assuming no objects are loaded) is going to have issues. Of course, that's assuming 128Mb memory limit.</p>

          <p>The trick here is that this would have to had an HTTP stream in order to work the way you're wanting. I'm not opposed to doing that, but I don't believe ZF is capable of that yet. I would say the best approach is to start with the simple case, then add the fringe cases after everything else is working.</p>

          <p>The current API would allow some sort of streaming pretty easily though, as all requests are filtered through Zend_Service_Amazon_S3_Connection::doRequest(). A possible solution would be to add a Z_S_A_S3_C::setRequestHandler(Object $handler) which would pass the HTTP request off to the container, then let it finish the request.</p>

          <p>Maybe there's a use for a Zend_Service_Amazon_S3_Connection_Request object to provide the basic API?</p>

  2. Jul 07, 2007

    <p>Hi, is anything going to happen with this proposal? I wrote my own S3 class using Zend_Http_Client and I thought I could write a proposal to get it in the framework if this one is dead.</p>

    1. Jul 07, 2007

      <p>Hey Tomas,</p>

      <p>There was never any commentary on this, so I haven't proceeded forward on getting the code into ZF.</p>


  3. Aug 14, 2007

    <p>I am really interested in having this proposal reviewed and accepted.</p>

    <p>In the mean time, Travis could you make the code available ?</p>

  4. Dec 12, 2007

    <p>Will there be specific methods to set the bucket or object Access Control policy during a PUT request? (x-amz-acl header)</p>

    <p>ie: private, public-read, public-read-write and authenticated-read status.</p>

    <p>Example: As the default is a highly restrictive 'private', if this bucket were to be read from a browser with no authentication, it should be possible to set READ access with x-amz-acl: public-read as part of the PUT request while writing the object.</p>

    <p>I feel it might be useful to have a separate method to set this value.</p>

    <p>This is a great component proposal and hope it gets accepted soon.</p>