定制 icyboy/lumen-aws-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

icyboy/lumen-aws-sdk

Composer 安装命令:

composer require icyboy/lumen-aws-sdk

包简介

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

README 文档

README

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

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.

Installation

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

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

Then run a composer update

php composer.phar update

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

Find the providers key in your bootstarp/app.php and register the AWS Service Provider.

    $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:

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.

php artisan vendor:publish

Update your settings in the generated config/aws.php configuration file.

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.

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

Links

统计信息

  • 总下载量: 13.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2016-11-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固