pxgamer / worldwidetorrents-php
PHP 编写的易于使用的 WorldWideTorrents API 包装器。
v1.2.2
2017-12-06 10:59 UTC
Requires
- php: ^7.1
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^6.4
- squizlabs/php_codesniffer: ^3.1
This package is auto-updated.
Last update: 2024-09-11 14:28:05 UTC
README
PHP 编写的易于使用的 WorldWideTorrents API 包装器。
结构
src/
tests/
vendor/
安装
通过 Composer
$ composer require pxgamer/worldwidetorrents-php
使用
$client = new Client(); // Use the specific classes as their short names use \pxgamer\WorldWideTorrents; // Create a new Client instance $client = new WorldWideTorrents\Client(); $client->setAuthKey('API_KEY'); // Initialise a new instance of each class $group = new WorldWideTorrents\Group($client); $mail = new WorldWideTorrents\Mail($client); $torrent = new WorldWideTorrents\Torrent($client); $user = new WorldWideTorrents\User($client); $account = new WorldWideTorrents\Account($client);
方法
客户端类
/** * This is required to be initialised first. * It must be passed into all other classes. */ use \pxgamer\WorldWideTorrents\Client; $client = new Client; $client->setAuthKey('API_KEY');
组类
use \pxgamer\WorldWideTorrents\Group; $group = new Group($client);
获取组的详细信息
$group->getInfo(3);
获取组的种子
$group->getTorrents(3);
邮件类
初始化邮件类
use \pxgamer\WorldWideTorrents\Mail; $mail = new Mail($client);
获取用户的邮件统计信息
$mail->getStats(656);
种子类
初始化种子类
use \pxgamer\WorldWideTorrents\Torrent; $torrent = new Torrent($client);
获取种子的详细信息
$torrent->getInfo(656);
用户类
初始化用户类
use \pxgamer\WorldWideTorrents\User; $user = new User($client);
获取用户信息
$user->getInfo(656);
获取用户种子
$user->getTorrents(656);
账户类
初始化账户类
// Requires the API key to be set in the Client class use \pxgamer\WorldWideTorrents\Account; $account = new Account($client);
上传种子
$account->upload('torrent_title', '@C:\torrents\t.torrent', 39);
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
测试
$ composer test
贡献
有关详细信息,请参阅 CONTRIBUTING 和 CODE_OF_CONDUCT。
安全性
如果您发现任何与安全性相关的问题,请通过电子邮件 owzie123@gmail.com 反馈,而不是使用问题跟踪器。
致谢
许可
MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件。