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 the
Zend_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 dataputFile()
- Used to create a new object from the given path nameputFileStream()
- Used to create a new object from a file stream (saves PHP reading in the entire file into memory asputFile()
does)removeObject()
- Removes the object from the bucketgetInfo()
- Retrieves information about a given objectIsObjectAvailable()
- Check if an object exists.getObject()
- Retrieves the data for the given objectgetObjectStream()
- Returns the data as a stream (saves PHP reading in the entire object into memory asgetObject()
does)getObjectsByBucket()
- Retrieve a list of objects in a bucket. You can filter this list by a given prefix.
No comments:
Post a Comment