承接 willicab/transmission 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 willicab/transmission 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-26