2017 © Pedro Peláez
 

library lumen-aws-sdk

A simple lumen 5 service provider for including the AWS SDK for PHP.

image

icyboy/lumen-aws-sdk

A simple lumen 5 service provider for including the AWS SDK for PHP.

  • Tuesday, November 1, 2016
  • by icyboy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,120 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 21 % Grown

The README.md

AWS Service Provider for Lumen 5

This is a simple Lumen service provider for making it easy to include the official AWS SDK for PHP in your Lumen applications., (*1)

This README is for version 1.x of the service provider, which is implemented to work with Version 3 of the AWS SDK for PHP and Lumen 5.X., (*2)

Installation

The AWS Service Provider can be installed via Composer by requiring the icyboy/lumen-aws-sdk package in your project's composer.json., (*3)

{
    "require": {
        "icyboy/lumen-aws-sdk": "^1.0"
    }
}

Then run a composer update, (*4)

php composer.phar update

To use the AWS Service Provider, you must register the provider when bootstrapping your Lumen application., (*5)

Find the providers key in your bootstarp/app.php and register the AWS Service Provider., (*6)

    $app->register(Icyboy\LumenAws\AwsServiceProvider::class);

    class_alias('Icyboy\LumenAws\AwsFacade', 'Aws');

Configuration

By default, the package uses the following environment variables to auto-configure the plugin without modification:, (*7)

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION (default = us-east-1)

To customize the configuration file, publish the package configuration using Artisan., (*8)

php artisan vendor:publish

Update your settings in the generated config/aws.php configuration file., (*9)

return [
    'credentials' => [
        'key'    => 'YOUR_AWS_ACCESS_KEY_ID',
        'secret' => 'YOUR_AWS_SECRET_ACCESS_KEY',
    ],
    'region' => 'us-west-2',
    'version' => 'latest',

    // You can override settings for specific services
    'Ses' => [
        'region' => 'us-east-1',
    ],

    // if you use fake s3, you must used endpoint
    'endpoint' => "http://xxxx",
];

Usage

$s3 = App::make('aws')->createClient('s3');
$s3->putObject(array(
    'Bucket'     => 'YOUR_BUCKET',
    'Key'        => 'YOUR_OBJECT_KEY',
    'SourceFile' => '/the/path/to/the/file/you/are/uploading.ext',
));

If the AWS facade is registered within the aliases section of the application configuration, you can also use the following technique., (*10)

$s3 = Aws::createClient('s3');
$s3->putObject(array(
    'Bucket'     => 'YOUR_BUCKET',
    'Key'        => 'YOUR_OBJECT_KEY',
    'SourceFile' => '/the/path/to/the/file/you/are/uploading.ext',
));

The Versions

01/11 2016

dev-master

9999999-dev http://aws.amazon.com/sdkforphp2

A simple lumen 5 service provider for including the AWS SDK for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

lumen amazon s3 aws sdk dynamodb ec2 lumen 5

01/11 2016

1.0.2

1.0.2.0 http://aws.amazon.com/sdkforphp2

A simple lumen 5 service provider for including the AWS SDK for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

lumen amazon s3 aws sdk dynamodb ec2 lumen 5

01/11 2016

1.0.1

1.0.1.0 http://aws.amazon.com/sdkforphp2

A simple lumen 5 service provider for including the AWS SDK for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

lumen amazon s3 aws sdk dynamodb ec2 lumen 5

01/11 2016

1.0.0

1.0.0.0 http://aws.amazon.com/sdkforphp2

A simple lumen 5 service provider for including the AWS SDK for PHP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

lumen amazon s3 aws sdk dynamodb ec2 lumen 5