printfshen/yii2-aliyun-oss

The aliyun-oss for the Yii framework

Installs: 22

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

v0.1.0 2018-11-28 01:47 UTC

This package is auto-updated.

Last update: 2024-04-28 13:52:11 UTC


README

Yii2 阿里云 OSS

Installation

The preferred way to install this extension is through composer.

Either run

        composer require printfshen/yii2-aliyun-oss

or add

        "printfshen/yii2-aliyun-oss": "dev-master"

to the require section of your composer.json file.

Usage

在params.php添加配置 :

    'oss' => [
        'accessKeyId' => 'accessKeyId',
        'accessKeySecret' => 'accessKeySecret',
        'bucket' => 'bucket',
        'endPoint' => 'endPoint', 
    ],

用法 :

 初始化 $oss = Oss::getInstance();
 上传   $oss->uploadFile($fileName, $filePath);
 删除   $oss->deleteFile($path);
 查看是否存在 $oss->doesFileExist($path);