aliyuncs/aliyun-oss-php-sdk-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

aliyuncs/aliyun-oss-php-sdk-laravel

最新稳定版本:v1.2.0

Composer 安装命令:

composer require aliyuncs/aliyun-oss-php-sdk-laravel

包简介

A simple Laravel 5 and lumen service provider for including the Oss PHP SDK for PHP.

README 文档

README

Build Status Coverage Status

README of Chinese

Make a Reference in Your Laravel Project

  • Install the Laravel framework or the Lumen framework.

  • Create a Laravel or Lumen project, depending on the framework you have installed.

  • In the composer.json file of the new project, insert the following code:

    {
        "require": {
            "aliyuncs/aliyun-oss-php-sdk-laravel": "~1.2.0"
        }
    }
    
  • Run the following command: composer update

For the Laravel Project

  • Edit the vendor/aliyun-oss/aliyun-oss-php-sdk-laravel/config/config.php file as follows:

    return [
        'id' => 'your id',
        'key' => 'your key',
        'endpoint' => 'your endpoint',
        'bucket' => 'your bucket'
    ];
    
  • Edit the config/app.php file and register OSS Service Provider:

    'providers' => array(
        // ...
        AliyunOss\Laravel\AliyunOssServiceProvider::class,
    )
    
  • Edit the config/app.php file to insert an aliases segment.

    'aliases' => array(
        // ...
        'OSS' => AliyunOss\Laravel\AliyunOssFacade::class,
    )
    
  • Edit the routes/web.php file as follows:

    Route::get('/', function()
    {
        $client = App::make('aliyun-oss');
        $client->putObject("your bucket", "your object", "content you want to upload");
        $result = $client->getObject("your bucket", "your boject");
        echo $result;
    });
    

For the Lumen Project

  • Edit the vendor/aliyun-oss/aliyun-oss-php-sdk-laravel/config/config.php file as follows:

    return [
        'id' => 'your id',
        'key' => 'your key',
        'endpoint' => 'your endpoint',
        'bucket' => 'your bucket'
    ];
    
  • Edit the bootstrap/app.php file and register OSS Service Providers:

    $app->register(AliyunOss\Laravel\AliyunOssServiceProvider::class);
    
  • Edit the routes/web.php file as follows:

    $app->get('/', function () use ($app) {
        $client = $app->make('aliyun-oss');
        $client->putObject('your bucket', 'your key',  "content you want to upload");
        $result = $client->getObject("your bucket", "your boject");
        echo $result;
    });
    

Run the Test Case

  • Set the following environment variables:
export OSS_ENDPOINT=''
export OSS_ACCESS_KEY_ID=''
export OSS_ACCESS_KEY_SECRET=''
export OSS_BUCKET=''
  • Switch to the project directory and run the following command: php vendor/bin/phpunit

License

统计信息

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

GitHub 信息

  • Stars: 75
  • Watchers: 8
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固