dkvhin/flysystem-onedrive

One Drive Adapter for Flysystem

v11.2.3 2024-08-05 00:49 UTC

README

Author Software License

Installation

composer require dkvhin/flysystem-onedrive

Usage

  • Follow Azure Docs to obtain your ClientId, ClientSecret & TenantId
  • Follow OneDrive Docs to obtain your 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);