dev-master
9999999-dev https://github.com/jlaso/aws-s3-wrapperAWS S3 Wrapper
MIT
The Requires
- php >=5.3.29
- aws/aws-sdk-php 2.*
amazon s3 aws
Wallogit.com
2017 © Pedro Peláez
AWS S3 Wrapper
This wrapper allows minimizing S3 access, maintaining a local cache (on server)., (*1)
add to the composer.json file of your project { ... "require": { ... "jlaso/aws-s3-wrapper": "dev-master", ... } }, (*2)
and run composer update, (*3)
or run
composer require jlaso/aws-s3-wrapper, (*4)
You can use the src/config.ini (created from src/config.ini.sample) in order to simplify access to the wrapper with S3Wrapper::getInstance()., (*5)
Or you can create your own instance passing the data the wrapper needs to be created: new S3Wrapper($accessKey, $secretKey, $bucket);, (*6)
You have to create cache folder and give 0755 permissions. Likely you have to change the owner/group to apache user/group., (*7)
In order to OOB test you can use the file samples/basic.php., (*8)
$s3 = new S3Wrapper($access, $secretm $bucket); $s3->getFileIfNewest($localFile, $remoteFile); // you have now the contents of $remoteFile on $localFile
$s3 = new S3Wrapper($access, $secretm $bucket); $s3->saveFile($remoteFile, $content);
$s3 = new S3Wrapper($access, $secretm $bucket); $fileList = $s3->getFilesList($path);
$s3 = new S3Wrapper($access, $secretm $bucket); $s3->deleteFile($localFile, $remoteFile);
AWS S3 Wrapper
MIT
amazon s3 aws