nicoswd / putio
PutIO OAuth API (v2) 的 PHP 5.4 封装
0.3.1
2015-02-19 19:36 UTC
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2024-09-06 08:16:44 UTC
README
这是一个强大的 PHP 库,用于put.io的OAuth2 API。它支持 put.io API 提供的所有原生功能,包括文件上传、下载、传输、朋友等... 无需任何依赖。
查看Wiki和put.io API 文档以开始使用。
在Twitter上找到我:@nicoSWD
查看具有严格类型提示和返回类型的实验性分支(PHP 7)
安装
通过 Composer
$ composer require "nicoswd/putio": "0.3.*"
通过 git
$ git clone git@github.com:nicoSWD/put.io-api-v2.git
用法
$putio = new PutIO\API($accessToken); // Retrieve a an array of files on your account. $files = $putio->files->listall(); // Upload a file. $file = 'path/to/file.jpg'; $putio->files->upload($file); // Download a file. $fileID = 1234; $saveAs = 'my-file.jpg'; $putio->files->download($fileID, $saveAs); // Search for files you have access to. $query = 'my file'; $files = $putio->files->search($query); // Add a new transfer (file or torrent) $url = 'http://torrent.site.com/legal_video.torrent'; $putio->transfers->add($url); // Get status of a transfer $transferID = 1234; $info = $putio->transfers->info($transferID); // And a lot more...
安全
如果您发现任何安全相关的问题,请通过security@nic0.me发送电子邮件,而不是使用问题跟踪器。
测试
$ phpunit
贡献
欢迎提交拉取请求!如果它们包括测试,那就更好了。本项目遵循 PSR-2 编码标准,请确保您的拉取请求也遵循。