dkvhin / flysystem-onedrive
Flysystem 的 OneDrive 适配器
v11.2.3
2024-08-05 00:49 UTC
Requires
- php: >=8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^10.0|^11.0
- league/flysystem: ^3.0
- microsoft/microsoft-graph: ^1.110
This package is auto-updated.
Last update: 2024-09-05 01:35:17 UTC
README
安装
composer require dkvhin/flysystem-onedrive
使用方法
- 按照Azure 文档进行操作以获取您的
ClientId, ClientSecret & TenantId
- 按照OneDrive 文档进行操作以获取您的
refreshToken
$token=new \Dkvhin\Flysystem\OneDrive\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 \Dkvhin\Flysystem\OneDrive\OneDriveAdapter($graph, '[root path]'); $filesystem = new \League\Flysystem\Filesystem($adapter);