2017 © Pedro Peláez
 

yii2-extension yii2-oss

Oss integration for the Yii framework

image

hxy2015/yii2-oss

Oss integration for the Yii framework

  • Monday, October 30, 2017
  • by hxy2015
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

An Oss client of yii2 extension.

Installation

The preferred way to install this extension is through composer., (*1)

Either run, (*2)

php composer.phar require --prefer-dist hxy2015/yii2-oss

or add, (*3)

"hxy2015/yii2-oss": "~1.0"

to the require section of your composer.json., (*4)

Configuration

To use this extension, you have to configure the Connection class in your application configuration:, (*5)

return [
    //....
    'components' => [
        'oss' => [
            'hostname' => 'localhost',
            'bucket' => 'risk-test',
            'accessId' => 'test', // oss id
            'accessKey' => 'test', // oss id
        ],
    ]
];

Usage

Upload File, (*6)

$oss = \Yii::$app->get('oss');
$oss->putObjectByContent('some_dir/some_file_name', 'hehe');

$filename = 'test.txt';
file_put_contents($filename, 'hehe');
$oss->putObjectByFile('some_dir/some_file_name', $filename);

Download File, (*7)

$oss = \Yii::$app->get('oss');
$oss->getObjectContent('some_dir/some_file_name');

$filename = 'test.txt';
$oss->getObjectFile('some_dir/some_file_name', $filename);

Test File Exist, (*8)

$oss = \Yii::$app->get('oss');
$oss->isObjectExist('some_dir/some_file_name');

The Versions

30/10 2017

dev-master

9999999-dev

Oss integration for the Yii framework

  Sources   Download

BSD-3-Clause

The Requires

 

by huangxy

yii2 oss

04/09 2017

1.0.0

1.0.0.0

Oss integration for the Yii framework

  Sources   Download

BSD-3-Clause

The Requires

 

by huangxy

yii2 oss