la-haute-societe / yii2-flysystem-google-drive
Flysystem Google Drive filesystem for Yii2
Installs: 18 576
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 6
Forks: 4
Open Issues: 2
Type:yii2-extension
Requires
- creocoder/yii2-flysystem: ^0.8.1
- nao-pon/flysystem-google-drive: ^1.1
- yiisoft/yii2: ^2.0.0
This package is auto-updated.
Last update: 2024-11-17 17:39:48 UTC
README
Flysystem Google Drive filesystem for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist la-haute-societe/yii2-flysystem-google-drive "^1.0.0"
or add
"la-haute-societe/yii2-flysystem-google-drive": "^1.0.0"
to the require section of your composer.json
file.
Usage
This extension is a Google Drive Filesystem for Yii2 Flysystem extension by @creocoder.
It uses the Flysystem Adapter for Google Drive by @nao-pon
For usage instructions, see Yii2 Flysystem documentation
You can get help on how to get clientID, clientSecret and refreshToken here (Thx @ivanvermeyen)
Configuration
Local filesystem
Configure application components
as follows
return [ //... 'components' => [ //... 'googleDrive' => [ 'class' => lhs\Yii2FlysystemGoogleDrive\GoogleDriveFilesystem::class, 'clientId' => 'xxx YOUR CLIENT ID xxx', 'clientSecret' => 'xxx YOUR CLIENT SECRET xxx', 'refreshToken' => 'xxx YOUR REFRESH TOKEN xxx', // 'driveId' => 'xxx YOUR TEAM DRIVE ID xxx', // 'rootFolderId' => 'xxx ROOT FOLDER ID xxx' ], ], ];
You can then access the flysystem API like:
$contents = Yii::$app->googleDrive->listContents(); ...