kriss / yii2-flysystem
yii2-flysystem
Installs: 174
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
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-10-16 19:50:25 UTC
README
yii2-flysystem
Installation
The preferred way to install this extension is through composer.
php composer.phar require --prefer-dist kriss/yii2-flysystem
config
return [ 'components' => [ // others 'storage' => [ 'class' => \kriss\storage\Storage::class, 'adapter' => function () { return new \League\Flysystem\Adapter\Local(Yii::getAlias('@webroot/files')); } ], ] ]
usage
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();