davicente / flysystem-onedrive
OneDrive适配器,用于flysystem文件系统抽象库
3.1.1
2017-06-06 10:25 UTC
Requires
- davicente/oauth2-microsoft: ^2.2
- guzzlehttp/guzzle: ^5.3
- league/flysystem: ^1.0
Requires (Dev)
- phpunit/phpunit: ^5.2
README
OneDrive适配器允许使用Flysystem文件系统抽象库与OneDrive进行交互。它使用Guzzle库与API通信。
安装
composer require davicente/flysystem-onedrive
使用方法
要与OneDrive API通信,您需要一个授权令牌。为了开发目的,请访问https://dev.onedrive.com/auth/msa_oauth.htm,点击“获取令牌”并将令牌粘贴到您的PHP应用程序中。
有关其他授权方式的详细信息,请参阅OneDrive API文档。
require 'vendor/autoload.php'; //paste a temporary token from https://dev.onedrive.com/auth/msa_oauth.htm $token = '123456789'; $oneDriveClient = new \JacekBarecki\FlysystemOneDrive\Client\OneDriveClient($token, new \GuzzleHttp\Client()); $oneDriveAdapter = new \JacekBarecki\FlysystemOneDrive\Adapter\OneDriveAdapter($oneDriveClient);
已知限制
OneDrive适配器目前有一些限制。如果您想为适配器开发做出贡献,请随意提交移除这些限制的pull请求。
-
目前,通过OneDrive API的“简单上传”方法支持保存文件。此方法仅支持大小不超过100MB的文件,并且未实现流支持。要支持更大的文件,需要实现可恢复上传方法。
-
当列出项并且集合中有超过200项时,只返回前200项。要支持更大的集合,客户端应按照OneDrive API文档中描述的方式多次调用API。这尚未实现。
另请参阅
请注意,OneDrive API是不区分大小写的。阅读OneDrive API文档以了解详细信息。