2017 © Pedro Peláez
 

yii2-extension yii2-filesystem-qiniu

Yii2 filesystem Qiniu

image

kriss/yii2-filesystem-qiniu

Yii2 filesystem Qiniu

  • Monday, September 18, 2017
  • by kriss
  • Repository
  • 2 Watchers
  • 2 Stars
  • 135 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 25 % Grown

The README.md

important: this project is deprecated, use kriss/yii2-flysystem instead, (*1)

Yii2 filesystem Qiniu

Qiniu storage for Laravel based on overtrue/flysystem-qiniu., (*2)

Installation

php composer.phar require --prefer-dist kriss/yii2-filesystem-qiniu -vvv

or add, (*3)

"kriss/yii2-filesystem-qiniu": "*"

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

Config

in web.php(under Basic Template) or main.php or main-local.php(under Advanced Template), (*5)

'components' => [
    ...
    'qiniu' => [
        'class' => \kriss\qiniu\QiNiuComponent::className(),
        'access_key' => 'xxx',
        'secret_key' => 'xxx',
        'bucket' => 'xxx',
        'domain' => 'xxx.xxx.com'
    ],
    ...
]

Usage

/** @var QiNiuComponent $qiniu */
$qiniu = Yii::$app->get(static::QI_NIU);
$disk = $qiniu->getDisk();

// create a file
$disk->put('avatars/1', $fileContents);

// check if a file exists
$exists = $disk->has('file.jpg');

// get timestamp
$time = $disk->lastModified('file1.jpg');
$time = $disk->getTimestamp('file1.jpg');

// copy a file
$disk->copy('old/file1.jpg', 'new/file1.jpg');

// move a file
$disk->move('old/file1.jpg', 'new/file1.jpg');

// get file contents
$contents = $disk->read('folder/my_file.txt');

Full API documentation., (*6)

The Versions

18/09 2017

dev-master

9999999-dev

Yii2 filesystem Qiniu

  Sources   Download

MIT

The Requires

 

by Avatar kriss

filesystem extension yii2 qiniu

18/09 2017

v1.0

1.0.0.0

Yii2 filesystem Qiniu

  Sources   Download

MIT

The Requires

 

by Avatar kriss

filesystem extension yii2 qiniu

07/06 2017

0.0.1

0.0.1.0

Yii2 filesystem Qiniu

  Sources   Download

MIT

The Requires

 

by Avatar kriss

filesystem extension yii2 qiniu