as247/flysystem-onedrive

One Drive Adapter for Flysystem

v1.0.5 2020-09-29 15:35 UTC

This package is auto-updated.

Last update: 2023-03-06 10:00:38 UTC


README

Author Software License

Installation

composer require as247/flysystem-onedrive:^1.0

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