willicab/transmission
Composer 安装命令:
composer create-project willicab/transmission
包简介
PHP implementation of Transmission RPC.
关键字:
README 文档
README
Another PHP implementation of Transmission RPC Spec.
Instalation
You can install as a Composer package:
composer require willicab/transmission
Usage
By default use 'http://localhost' as host and 9091 as port and not username and password
<?php require 'vendor/autoload.php'; use Willicab\Transmission\Client; $tm = new Client(); $tm->connect();
If you can set the parameters you can pass as array
<?php require 'vendor/autoload.php'; use Willicab\Transmission\Client; $arguments = [ 'host' => 'http://another.host', 'port' => 1234, 'user' => 'transmission', 'password' => 'transmission' ]; $tm = new Client($arguments); $tm->connect();
Torrent Action Requests
The argument is the ids of the torrents, they can be:
- An integer referring to a torrent id.
- A list of torrent id numbers, sha1 hash strings, or both
- A string, "recently-active", for recently-active torrents
$tm->torrentStart(); $tm->torrentStartNow(1); $tm->torrentStop([1, 3, '3343d0e7c66f29d2f0ce9af951d367020eedc38c']); $tm->torrentVerify('recently-active'); $tm->torrentReannounce('3343d0e7c66f29d2f0ce9af951d367020eedc38c');
Torrent Set
You can see the list of available arguments in the spec file, point 3.2.
$arguments = [ 'downloadLimit' => 1000, 'downloadLimited' => true, ]; $tm->torrentSet(2, $arguments); $tm->torrentSet(1, $arguments); $tm->torrentSet([1, 3, '3343d0e7c66f29d2f0ce9af951d367020eedc38c'], $arguments); $tm->torrentSet('recently-active', $arguments);
Torrent Get
You can see the list of available arguments in the spec file, point 3.3.
$arguments = ['id, 'name', 'downloadLimit', 'downloadLimited']; $tm->torrentGet(2, $arguments); $tm->torrentGet(1, $arguments); $tm->torrentGet([1, 3, '3343d0e7c66f29d2f0ce9af951d367020eedc38c'], $arguments); $tm->torrentGet('recently-active', $arguments);
Adding a Torrent
You can see the list of available arguments in the spec file, point 3.4.
You can add a torrent with two methods:
$arguments = [ 'download-dir' => '/home/user/Downloads/', 'paused' => true, ]; $tm->addFilename('magnet:?xt=urn:btih:c39fe3eefbdb62da9c27eb6398ff4a7d2e26e7ab&dn=Big.Buck.Bunny.BDRip.XviD-MEDiC&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969', $arguments); $tm->addFilename('https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-9.5.0-amd64-DVD-1.iso.torrent', $arguments);
$arguments = [ 'download-dir' => '/home/user/Downloads/', 'paused' => true, ]; $tm->addMetainfo('ZDg6YW5ub3VuY2U0MTpodHRwOi8vYnR0cmFja2VyLmRlYmlhbi5vcmc6Njk ... wnJ273LLn4nZC2PNVQvHbmy89ucgL8I2QDGQZWU=', $arguments);
Removing a Torrent
$tm->torrentRemove(2); // remove from list $tm->torrentRemove('3343d0e7c66f29d2f0ce9af951d367020eedc38c', true); // remove from list and delete the files
Moving a Torrent
$tm->torrentSetLocation(1, '/home/user/Downloaded/', true);
Renaming a Torrent's Path
$tm->torrentRenamePath(1, '/home/user/Downloads/The Torrent', '/home/user/Downloaded/My Torrent');
Session Set
You can see the list of available arguments in the spec file, point 4.1.
$arguments = [ 'download-dir' => '/home/user/Downloads/', 'start-added-torrents' => true, ]; $tm->sessionSet($arguments);
Session Get
$tm->sessionGet();
Session Statistics
$tm->sessionStats();
Blocklist
$tm->blocklistUpdate();
Port Checking
$tm->portTest();
Session shutdown
$tm->sessionClose();
Queue Movement Requests
$tm->queueMove(1, 'top'); $tm->queueMove([2, 3], 'up'); $tm->queueMove('3343d0e7c66f29d2f0ce9af951d367020eedc38c', 'down'); $tm->queueMove(2, 'bottom');
Free Space
$tm->freeSpace('/home/user/Downloads/');
willicab/transmission 适用场景与选型建议
willicab/transmission 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 10 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「rpc」 「php」 「torrent」 「transmission」 「p2p」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 willicab/transmission 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 willicab/transmission 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 willicab/transmission 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Microservice RPC through message queues.
Extract media information from torrent-like filename
Composer version of torrent-rw https://github.com/adriengibrat/torrent-rw
Control Nginx as a reverse proxy through plinker RPC
PHP Transmission client
PHP 5.4 wrapper for PutIO's OAuth API (v2)
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-26