I'm attempting to list the files in my S3 bucket but I keep getting a PHP Error when running this code:
require_once './S3.php';
define('awsAccessKey', 'xxx');
define('awsSecretKey', 'xxx');
$s3 = new S3(awsAccessKey, awsSecretKey);
$objects = $s3->list_objects("BUCKETNAME",array("max-keys"=>5));
foreach ($objects->body->Contents as $item){
print_r($item->Key."");
}
I get:
PHP Fatal error: Call to undefined method S3::list_objects()
Google isn't helping me. I can put files in my bucket but I can't list them. Any ideas?