jplarar/s3-bundle

A simple Symfony2 bundle for the API for AWS S3.

Installs: 1 253

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.4.8 2023-06-16 00:16 UTC

This package is auto-updated.

Last update: 2024-04-16 02:23:59 UTC


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);
?>