as247 / flysystem-onedrive
One Drive Adapter for Flysystem
Installs: 34 080
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: >=7.1
- ext-json: *
- as247/cloud-storages: ^1.2.6
- league/flysystem: ^3.23
- microsoft/microsoft-graph: ^1.110
README
Installation
composer require as247/flysystem-onedrive
Usage
- Follow Azure Docs to obtain your
ClientId, ClientSecret & TenantId
- Follow OneDrive Docs to obtain your
refreshToken
$token=new \As247\CloudStorages\Support\OneDriveOauth(); $token->setClientId('[Client ID]'); $token->setTenantId('[Tenant ID]'); $token->setClientSecret('[Client secret]'); $token->setRefreshToken('[Refresh token]'); $graph = new \Microsoft\Graph\Graph(); $graph->setAccessToken($token->getAccessToken()); $adapter = new \As247\Flysystem\OneDrive\OneDriveAdapter($graph, '[root path]'); $filesystem = new \League\Flysystem\Filesystem($adapter);