Zend Framework 101: Zend_Service_Amazon_S3
Connecting to Amazon S3
Now that you have an AWS Key and an AWS Secret Key you can connect to Amazon S3. To access Amazon S3 with the Zend Framework you will be using the class
For the purposes of this article we'll assume your AWS Key is stored in a variable called
$awsKey, and your AWS Secret Key is stored in a variable called
$awsSecretKey. The following example shows how to specify your keys each time you instantiate the class.
require_once('Zend/Service/Amazon/S3.php'); $s3 = new Zend_Service_Amazon_S3($awsKey, $awsSecretKey);
require_once('Zend/Service/Amazon/S3.php'); Zend_Service_Amazon_S3::setKeys($awsKey, $awsSecretKey); $s3 = new Zend_Service_Amazon_S3(); $anotherS3 = new Zend_Service_Amazon_S3();