as247/flysystem-onedrive

One Drive Adapter for Flysystem

v3.0.2 2024-02-04 15:18 UTC

This package is auto-updated.

Last update: 2024-03-30 10:49:23 UTC


README

Author Software License

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);