jplarar / s3-bundle
A simple Symfony2 bundle for the API for AWS S3.
Installs: 1 277
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3
- aws/aws-sdk-php: ^3.0
- sensio/framework-extra-bundle: >=2.1
- symfony/config: >=2.1
- symfony/dependency-injection: >=2.1
- symfony/filesystem: >=2.1
- symfony/framework-bundle: >=2.1
- symfony/http-foundation: >=2.1
- symfony/http-kernel: >=2.1
- symfony/options-resolver: >=2.1
- symfony/security: >=2.1
- symfony/validator: >=2.1
README
A simple Symfony2 bundle for the API for AWS S3.
Setup
Step 1: Download JplararS3Bundle using composer
Add S3 Bundle in your composer.json:
{ "require": { "jplarar/s3-bundle": "dev-master" } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update "jplarar/s3-bundle"
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Jplarar\S3Bundle\JplararS3Bundle() ); }
Step 3: Add configuration
# app/config/config.yml jplarar_s3: amazon_s3: amazon_s3_key: %amazon_s3_key% amazon_s3_secret: %amazon_s3_secret% amazon_s3_bucket: %amazon_s3_bucket% amazon_s3_region: %amazon_s3_region%
Usage
Using service
<?php $s3Client = $this->get('amazon_s3_client'); ?>
##Example
###Upload new file to S3
<?php $s3Client->write($key, $content, $mimeType); ?>