kriss / yii2-flysystem
yii2-flysystem
v1.1
2018-10-16 03:53 UTC
Requires
- league/flysystem: ^1.0
- yiisoft/yii2: ~2.0.0
Suggests
- overtrue/flysystem-qiniu: qiniu
- xxtime/flysystem-aliyun-oss: aliyun-oss
This package is auto-updated.
Last update: 2024-09-16 19:38:58 UTC
README
yii2-flysystem
安装
安装此扩展的首选方式是通过 composer。
php composer.phar require --prefer-dist kriss/yii2-flysystem
配置
return [ 'components' => [ // others 'storage' => [ 'class' => \kriss\storage\Storage::class, 'adapter' => function () { return new \League\Flysystem\Adapter\Local(Yii::getAlias('@webroot/files')); } ], ] ]
使用方法
use kriss\storage\Storage; use Yii; /** @var Storage $storage */ $storage = Yii::$app->get('storage'); $fileSystem = $storage->getFileSystem(); $adapter = $storage->getAdapter(); // or $adapter = $storage->getFileSystem()->getAdapter();