Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 806 Bytes

README.md

File metadata and controls

32 lines (18 loc) · 806 Bytes

php-amazon-s3-helper

A simple wrapper for the S3 library amazon-s3-php-class

Requirements

You have to have the Amazon S3 PHP Class included in your path somewhere. This class relies on that library being there!

Usage

Instantiate a new object with your aws key and secret:

$amazonObj = new AmazonHelper($awsAccessKey, $awsSecretKey);

And then you can retrieve items from S3

$obj = $amazonObj->getFile($bucketname, $path, $localPath);

And put them there:

$res = $amazonObj->putFile(array("file"=>$fileName), $bucketname, $name_on_s3);

It can also list all the values in a given bucket:

$buck_contents = $amazonObj->getBucketContents($bucketname);

Enjoy,

--Charlie