v1.0
1.0.0.0Yii2 Flysystem Component
BSD-3-Clause
The Requires
by Ali Irani
filesystem component yii2 flysystem
dev-master
9999999-devYii2 Flysystem Component
BSD-3-Clause
The Requires
by Ali Irani
filesystem component yii2 flysystem
Wallogit.com
2017 © Pedro Peláez
Yii2 Flysystem Component
The Flysystem component for Yii2 PHP framework with more flexibility than similar components and integrated with Flysystem MountManager and returns Flysystem objects as Yii2 component that helps to work with other libraries integrated with Flysystem like Glide ., (*1)
The preferred way to install this extension is through composer ., (*2)
Either run, (*3)
composer require airani/yii2-flysystem
or add, (*4)
"airani/yii2-flysystem": "~1.0"
to the require section of your composer.json file., (*5)
Configure application components for any of filesystem adapter as follows, (*6)
return [
// ...
'componenets' => [
// ...
'flysystem' => [
'class' => 'airani\flysystem\MountManager',
'localFs' => [ // https://flysystem.thephpleague.com/adapter/local/
'class' => 'League\Flysystem\Adapter\Local',
'root' => __DIR__.'/path/to/too',
],
'ftpFs' => [ // https://flysystem.thephpleague.com/adapter/ftp/
'class' => 'League\Flysystem\Adapter\Ftp',
'config' => [
'host' => 'ftp.example.com',
'username' => 'username',
'password' => 'password',
// optional config settings
'port' => 21,
'root' => '/path/to/root',
'passive' => true,
'ssl' => true,
'timeout' => 30,
],
],
// and config other filesystem adapters
// read adapters section of flysystem guide https://flysystem.thephpleague.com
],
],
];
To work with MountManager :, (*7)
// Read from FTP
$contents = Yii::$app->flysystem->read('ftp://some/file.txt');
// And write to local
Yii::$app->flysystem->write('local://put/it/here.txt', $contents);
Or simple usage:, (*8)
Yii::$app->filesystem->localFs->write('path/to/file.txt', 'contents');
for how to work with flysystem read this api documentation ., (*9)
Yii2 Flysystem Component
BSD-3-Clause
filesystem component yii2 flysystem
Yii2 Flysystem Component
BSD-3-Clause
filesystem component yii2 flysystem