as247/flysystem-onedrive

One Drive Adapter for Flysystem

v3.0.3 2024-05-30 14:40 UTC

This package is auto-updated.

Last update: 2024-11-30 16:02:19 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);