chitika Ad

Saturday, 1 March 2014

Zend Framework 101: Zend_Service_Amazon_S3

Zend Framework 101: Zend_Service_Amazon_S3

Managing Objects in Amazon S3 Buckets

You can manage objects in an S3 bucket either by using the functions provided in theZend_Service_Amazon_S3 class, or by registering S3 as a PHP stream and using the native stream handling functions (such as fopen()fread()fwrite(), etc.).
We're only going to look at the API methods in this article; refer to Zend Framework documentation for more details about using streams. The primary methods are as follows:
  • putObject() - Used to create a new object with the given data
  • putFile() - Used to create a new object from the given path name
  • putFileStream() - Used to create a new object from a file stream (saves PHP reading in the entire file into memory as putFile() does)
  • removeObject() - Removes the object from the bucket
  • getInfo() - Retrieves information about a given object
  • IsObjectAvailable() - Check if an object exists.
  • getObject() - Retrieves the data for the given object
  • getObjectStream() - Returns the data as a stream (saves PHP reading in the entire object into memory as getObject() does)
  • getObjectsByBucket() - Retrieve a list of objects in a bucket. You can filter this list by a given prefix.

No comments:

Post a Comment