hevelius / flysystem-onedrive
OneDrive API 的 Flysystem 适配器
v1.0.6
2019-10-24 06:38 UTC
Requires
- php: ^7.0
- league/flysystem: ^1.0
- microsoft/microsoft-graph: ^1.0
Requires (Dev)
- phpunit/phpunit: ^6.0
README
Microsoft OneDrive API 的 Flysystem 适配器
此包包含 OneDrive 的 Flysystem 适配器。底层使用 Microsoft Graph SDK。
安装
您可以通过 composer 安装此包
composer require hevelius/flysystem-onedrive
或在 composer.json 中直接添加此仓库
"repositories": [ { "url": "https://github.com/hevelius/flysystem-onedrive.git", "type": "git" } ],
用法
首先,您需要获取 Microsoft Graph API 的授权令牌。为此,您需要在 Microsoft Azure Portal 上创建一个应用。
use Microsoft\Graph\Graph; use League\Flysystem\Filesystem; use MarioPerrotta\FlysystemOneDrive\OneDriveAdapter; $graph = new Graph(); $graph->setAccessToken('EwBIA8l6BAAU7p9QDpi...'); $adapter = new OneDriveAdapter($graph, 'root'); $filesystem = new Filesystem($adapter); // Or to use the approot endpoint: $adapter = new OneDriveAdapter($graph, 'special/approot');
更新日志
请参阅 CHANGELOG 获取更多最近更改的信息。
测试
$ composer test
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全
如果您发现任何安全相关的问题,请通过电子邮件发送至 nicolasbeauvais1@gmail.com,而不是使用问题跟踪器。
致谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件。