本文整理汇总了PHP中getCmd函数的典型用法代码示例。如果您正苦于以下问题:PHP getCmd函数的具体用法?PHP getCmd怎么用?PHP getCmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCmd函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkCmd
function checkCmd($httpReq, $cmd)
{
$cmd = getCmd($httpReq);
if ($cmd !== $cmd) {
WrongRequestException::throwException(8030, "Only the command >{$cmd}< is accepted", 'got: ' . $reqdecoded['cmd']);
}
}
开发者ID:ppschweiz,项目名称:vvvote,代码行数:7,代码来源:getcmd.php
示例2: createTorrent
public static function createTorrent($torrent, $hash)
{
global $saveUploadedTorrents;
$torrent = new Torrent($torrent);
if ($torrent->errors()) {
return self::STE_DELETED;
}
if ($torrent->hash_info() == $hash) {
return self::STE_UPTODATE;
}
$req = new rXMLRPCRequest(array(new rXMLRPCCommand("d.get_directory_base", $hash), new rXMLRPCCommand("d.get_custom1", $hash), new rXMLRPCCommand("d.get_throttle_name", $hash), new rXMLRPCCommand("d.get_connection_seed", $hash), new rXMLRPCCommand("d.is_open", $hash), new rXMLRPCCommand("d.is_active", $hash), new rXMLRPCCommand("d.get_state", $hash), new rXMLRPCCommand("d.stop", $hash), new rXMLRPCCommand("d.close", $hash)));
if ($req->success()) {
$addition = array(getCmd("d.set_connection_seed=") . $req->val[3], getCmd("d.set_custom") . "=chk-state," . self::STE_UPDATED, getCmd("d.set_custom") . "=chk-time," . time(), getCmd("d.set_custom") . "=chk-stime," . time());
$isStart = $req->val[4] != 0 && $req->val[5] != 0 && $req->val[6] != 0;
if (!empty($req->val[2])) {
$addition[] = getCmd("d.set_throttle_name=") . $req->val[2];
}
if (preg_match('/rat_(\\d+)/', $req->val[3], $ratio)) {
$addition[] = getCmd("view.set_visible=") . "rat_" . $ratio;
}
$label = rawurldecode($req->val[1]);
if (rTorrent::sendTorrent($torrent, $isStart, false, $req->val[0], $label, $saveUploadedTorrents, false, true, $addition)) {
$req = new rXMLRPCRequest(new rXMLRPCCommand("d.erase", $hash));
if ($req->success()) {
return null;
}
}
}
return self::STE_ERROR;
}
开发者ID:limerainne,项目名称:ruTorrent,代码行数:30,代码来源:check.php
示例3: correct
public function correct()
{
$toCorrect = array();
$req = new rXMLRPCRequest(new rXMLRPCCommand("d.multicall", array("", getCmd("d.get_hash="), getCmd("d.get_throttle_name="), getCmd('cat') . '=$' . getCmd("get_throttle_up_max") . '=$' . getCmd("d.get_throttle_name="), getCmd('cat') . '=$' . getCmd("get_throttle_down_max") . '=$' . getCmd("d.get_throttle_name="))));
if ($req->run() && !$req->fault) {
for ($i = 0; $i < count($req->val); $i += 4) {
if (substr($req->val[$i + 1], 0, 4) == "thr_") {
$no = intval(substr($req->val[$i + 1], 4));
if ($req->val[$i + 2] === "-1" && $req->val[$i + 3] === "-1" && $this->isThrottled($no)) {
$toCorrect[$req->val[$i]] = $req->val[$i + 1];
}
}
}
if ($this->init()) {
$req = new rXMLRPCRequest();
foreach ($toCorrect as $hash => $name) {
$req->addCommand(new rXMLRPCCommand("branch", array($hash, getCmd("d.is_active="), getCmd('cat') . '=$' . getCmd("d.stop") . '=,$' . getCmd("d.set_throttle_name=") . $name . ',$' . getCmd('d.start='), getCmd('d.set_throttle_name=') . $name)));
}
if ($req->getCommandsCount()) {
return $req->run() && !$req->fault;
}
return true;
}
}
return false;
}
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:26,代码来源:throttle.php
示例4: rXMLRPCCommand
public function rXMLRPCCommand($cmd, $args = null)
{
$this->command = getCmd($cmd);
$this->params = array();
if ($args !== null) {
if (is_array($args)) {
foreach ($args as $prm) {
$this->addParameter($prm);
}
} else {
$this->addParameter($args);
}
}
}
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:14,代码来源:xmlrpc.php
示例5: rXMLRPCCommand
public function rXMLRPCCommand($cmd, $args = null)
{
$this->command = getCmd($cmd);
$this->params = array();
rTorrentSettings::get()->patchDeprecatedCommand($this, $cmd);
if ($args !== null) {
if (is_array($args)) {
foreach ($args as $prm) {
$this->addParameter($prm);
}
} else {
$this->addParameter($args);
}
}
}
开发者ID:jcvfen,项目名称:rutorrent,代码行数:15,代码来源:xmlrpc.php
示例6: getRatiosStat
function getRatiosStat()
{
$req = new rXMLRPCRequest(new rXMLRPCCommand("d.multicall", array("main", getCmd("d.get_hash="))));
$ret = 'theWebUI.ratiosStat = {';
if ($req->run() && !$req->fault) {
$tm = time();
for ($i = 0; $i < count($req->val); $i++) {
$st = new rStat("torrents/" . $req->val[$i] . ".csv");
$ratios = $st->getRatios($tm);
if ($ret != 'theWebUI.ratiosStat = {') {
$ret .= ',';
}
$ret .= '"' . $req->val[$i] . '": [' . $ratios[0] . ',' . $ratios[1] . ',' . $ratios[2] . ']';
}
}
return $ret . '}; ';
}
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:17,代码来源:ratios.php
示例7: eval
<?php
require_once 'xmlrpc.php';
eval(getPluginConf($plugin["name"]));
$listPath = getSettingsPath() . "/erasedata";
@makeDirectory($listPath);
$thisDir = dirname(__FILE__);
$req = new rXMLRPCRequest(array($theSettings->getOnEraseCommand(array('erasedata0' . getUser(), getCmd('d.open') . '= ; ' . getCmd('branch=') . getCmd('d.get_custom5') . '=,"' . getCmd('f.multicall') . '=,\\"' . getCmd('execute') . '={' . $thisDir . '/cat.sh,' . $listPath . ',$system.pid=,$' . getCmd('f.get_frozen_path') . '=}\\""')), $theSettings->getOnEraseCommand(array('erasedata1' . getUser(), getCmd('branch=') . getCmd('d.get_custom5') . '=,"' . getCmd('execute') . '={' . $thisDir . '/fin.sh,' . $listPath . ',$' . getCmd('system.pid') . '=,$' . getCmd('d.get_hash') . '=,$' . getCmd('d.get_base_path') . '=,$' . getCmd('d.is_multi_file') . '=,$' . getCmd('d.get_custom5') . '=}"')), $theSettings->getAbsScheduleCommand("erasedata", $garbageCheckInterval, getCmd('execute') . '={sh,-c,' . escapeshellarg(getPHP()) . ' ' . escapeshellarg($thisDir . '/update.php') . ' ' . escapeshellarg(getUser()) . ' &}')));
if ($req->success()) {
$theSettings->registerPlugin($plugin["name"], $pInfo["perms"]);
} else {
$jResult .= "plugin.disable(); noty('erasedata: '+theUILang.pluginCantStart,'error');";
}
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:13,代码来源:init.php
示例8: rXMLRPCRequest
<?php
$req = new rXMLRPCRequest(array($theSettings->getOnFinishedCommand(array("seedingtime" . getUser(), getCmd('d.set_custom') . '=seedingtime,"$' . getCmd('execute_capture') . '={date,+%s}"')), $theSettings->getOnInsertCommand(array("addtime" . getUser(), getCmd('d.set_custom') . '=addtime,"$' . getCmd('execute_capture') . '={date,+%s}"')), $theSettings->getOnHashdoneCommand(array("seedingtimecheck" . getUser(), getCmd('branch=') . '$' . getCmd('not=') . '$' . getCmd('d.get_complete=') . ',,' . getCmd('d.get_custom') . '=seedingtime,,"' . getCmd('d.set_custom') . '=seedingtime,$' . getCmd('d.get_custom') . '=addtime' . '"'))));
if ($req->success()) {
$theSettings->registerPlugin($plugin["name"], $pInfo["perms"]);
} else {
$jResult .= "plugin.disable(); noty('seedingtime: '+theUILang.pluginCantStart,'error');";
}
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:8,代码来源:init.php
示例9: setHandlers
public function setHandlers()
{
global $rootPath;
if ($this->enabled) {
$cmd = rTorrentSettings::get()->getOnFinishedCommand(array('unpack' . getUser(), getCmd('execute') . '={' . getPHP() . ',' . $rootPath . '/plugins/unpack/update.php,$' . getCmd('d.get_directory') . '=,$' . getCmd('d.get_base_filename') . '=,$' . getCmd('d.is_multi_file') . '=,$' . getCmd('d.get_custom1') . '=,$' . getCmd('d.get_name') . '=,' . getCmd('d.get_hash') . '=,' . getUser() . '}'));
} else {
$cmd = rTorrentSettings::get()->getOnFinishedCommand(array('unpack' . getUser(), getCmd('cat=')));
}
$req = new rXMLRPCRequest($cmd);
return $req->success();
}
开发者ID:jcvfen,项目名称:rutorrent,代码行数:11,代码来源:unpack.php
示例10: rXMLRPCRequest
<?php
$req = new rXMLRPCRequest(array(rTorrentSettings::get()->getRemoveScheduleCommand("ratio"), rTorrentSettings::get()->getOnInsertCommand(array('_ratio' . getUser(), getCmd('cat=')))));
$req->run();
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:4,代码来源:done.php
示例11: rXMLRPCRequest
<?php
$req = new rXMLRPCRequest(array($theSettings->getOnResumedCommand(array('quotapauser' . getUser(), getCmd('cat='))), new rXMLRPCCommand("schedule_remove", 'quotaspace' . getUser())));
$req->run();
开发者ID:RobbieL811,项目名称:rutorrent_stuff,代码行数:4,代码来源:done.php
示例12: flush
public function flush()
{
$req1 = new rXMLRPCRequest(new rXMLRPCCommand("view_list"));
if ($req1->run() && !$req1->fault) {
$insCmd = getCmd('branch=');
$req = new rXMLRPCRequest();
for ($i = 0; $i < MAX_RATIO; $i++) {
$insCmd .= getCmd('d.views.has=') . 'rat_' . $i . ',,';
$rat = $this->rat[$i];
if (!in_array("rat_" . $i, $req1->val)) {
$req->addCommand(new rXMLRPCCommand("group.insert_persistent_view", array("", "rat_" . $i)));
}
if ($this->isCorrect($i)) {
$req->addCommand(new rXMLRPCCommand("group.rat_" . $i . ".ratio.enable", array("")));
$req->addCommand(new rXMLRPCCommand("group.rat_" . $i . ".ratio.min.set", $rat["min"]));
$req->addCommand(new rXMLRPCCommand("group.rat_" . $i . ".ratio.max.set", $rat["max"]));
$req->addCommand(new rXMLRPCCommand("group.rat_" . $i . ".ratio.upload.set", floatval($rat["upload"] * 1024 * 1024)));
switch ($rat["action"]) {
case RAT_STOP:
$req->addCommand(new rXMLRPCCommand("system.method.set", array("group.rat_" . $i . ".ratio.command", getCmd("d.stop=") . "; " . getCmd("d.close="))));
break;
case RAT_STOP_AND_REMOVE:
$req->addCommand(new rXMLRPCCommand("system.method.set", array("group.rat_" . $i . ".ratio.command", getCmd("d.stop=") . "; " . getCmd("d.close=") . "; " . getCmd("view.set_not_visible") . "=rat_" . $i . "; " . getCmd("d.views.remove") . "=rat_" . $i)));
break;
case RAT_ERASE:
$req->addCommand(new rXMLRPCCommand("system.method.set", array("group.rat_" . $i . ".ratio.command", getCmd("d.stop=") . "; " . getCmd("d.close=") . "; " . getCmd("d.erase="))));
break;
case RAT_ERASEDATA:
$req->addCommand(new rXMLRPCCommand("system.method.set", array("group.rat_" . $i . ".ratio.command", getCmd("d.stop=") . "; " . getCmd("d.close=") . "; " . getCmd("d.set_custom5=") . "1; " . getCmd("d.erase="))));
break;
default:
$thr = "thr_" . ($rat["action"] - RAT_FIRSTTHROTTLE);
$req->addCommand(new rXMLRPCCommand("system.method.set", array("group.rat_" . $i . ".ratio.command", getCmd('cat') . '=$' . getCmd("d.stop") . '=,$' . getCmd("d.set_throttle_name=") . $thr . ',$' . getCmd('d.start='))));
break;
}
}
}
if ($this->isCorrect($this->default - 1)) {
$req->addCommand(rTorrentSettings::get()->getOnInsertCommand(array('_ratio' . getUser(), $insCmd . getCmd('view.set_visible=') . 'rat_' . ($this->default - 1))));
} else {
$req->addCommand(rTorrentSettings::get()->getOnInsertCommand(array('_ratio' . getUser(), getCmd('cat='))));
}
return $req->run() && !$req->fault;
}
return false;
}
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:46,代码来源:ratio.php
示例13: setHandlers
public function setHandlers()
{
global $autowatch_interval;
$theSettings = rTorrentSettings::get();
$req = new rXMLRPCRequest($theSettings->getOnInsertCommand(array('autolabel' . getUser(), getCmd('cat='))));
$pathToAutoTools = dirname(__FILE__);
if ($this->enable_label) {
$cmd = $theSettings->getOnInsertCommand(array('_autolabel' . getUser(), getCmd('branch') . '=$' . getCmd('not') . '=$' . getCmd("d.get_custom1") . '=,"' . getCmd('execute') . '={' . getPHP() . ',' . $pathToAutoTools . '/label.php,$' . getCmd("d.get_hash") . '=,' . getUser() . '}"'));
} else {
$cmd = $theSettings->getOnInsertCommand(array('_autolabel' . getUser(), getCmd('cat=')));
}
$req->addCommand($cmd);
if ($this->enable_move && trim($this->path_to_finished) != '') {
if ($theSettings->iVersion < 0x808) {
$cmd = $theSettings->getOnFinishedCommand(array('automove' . getUser(), getCmd('d.set_custom') . '=x-dest,"$' . getCmd('execute_capture') . '={' . getPHP() . ',' . $pathToAutoTools . '/move.php,$' . getCmd('d.get_hash') . '=,$' . getCmd('d.get_base_path') . '=,$' . getCmd('d.get_base_filename') . '=,$' . getCmd('d.is_multi_file') . '=,' . getUser() . '}" ; ' . getCmd('branch') . '=$' . getCmd('not') . '=$' . getCmd('d.get_custom') . '=x-dest,,' . getCmd('d.set_directory_base') . '=$' . getCmd('d.get_custom') . '=x-dest'));
} else {
if ($this->fileop_type == "Move") {
$cmd = $theSettings->getOnFinishedCommand(array('automove' . getUser(), getCmd('d.set_directory_base') . '="$' . getCmd('execute_capture') . '={' . getPHP() . ',' . $pathToAutoTools . '/check.php,$' . getCmd('d.get_base_path') . '=,$' . getCmd('d.get_base_filename') . '=,$' . getCmd('d.is_multi_file') . '=,' . getUser() . '}" ; ' . getCmd('execute') . '={' . getPHP() . ',' . $pathToAutoTools . '/move.php,$' . getCmd('d.get_hash') . '=,$' . getCmd('d.get_base_path') . '=,$' . getCmd('d.get_base_filename') . '=,$' . getCmd('d.is_multi_file') . '=,' . getUser() . '}'));
} else {
$cmd = $theSettings->getOnFinishedCommand(array('automove' . getUser(), getCmd('execute') . '={' . getPHP() . ',' . $pathToAutoTools . '/move.php,$' . getCmd('d.get_hash') . '=,$' . getCmd('d.get_base_path') . '=,$' . getCmd('d.get_base_filename') . '=,$' . getCmd('d.is_multi_file') . '=,' . getUser() . '}'));
}
}
} else {
$cmd = $theSettings->getOnFinishedCommand(array('automove' . getUser(), getCmd('cat=')));
}
$req->addCommand($cmd);
if ($this->enable_watch && trim($this->path_to_watch) != '') {
$cmd = $theSettings->getAbsScheduleCommand('autowatch', $autowatch_interval, getCmd('execute') . '={sh,-c,' . escapeshellarg(getPHP()) . ' ' . escapeshellarg($pathToAutoTools . '/watch.php') . ' ' . escapeshellarg(getUser()) . ' &}');
} else {
$cmd = $theSettings->getRemoveScheduleCommand('autowatch');
}
$req->addCommand($cmd);
return $req->success();
}
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:34,代码来源:autotools.php
示例14: rXMLRPCRequest
<?php
require_once '../plugins/retrackers/retrackers.php';
$req = new rXMLRPCRequest(array($theSettings->getOnInsertCommand(array('tadd_trackers1' . getUser(), getCmd('d.set_custom4') . '=$' . getCmd('cat') . '=$' . getCmd('d.get_state='))), $theSettings->getOnInsertCommand(array('tadd_trackers2' . getUser(), getCmd('branch') . '=$' . getCmd('not') . '=$' . getCmd('d.get_custom3') . '=,"' . getCmd('cat') . '=$' . getCmd('d.stop') . '=,\\"$' . getCmd('execute') . '={sh,' . $rootPath . '/plugins/retrackers/run.sh' . ',' . getPHP() . ',$' . getCmd('d.get_hash') . '=,' . getUser() . '}\\"" ; ' . getCmd('d.set_custom3=')))));
if ($req->run() && !$req->fault) {
$theSettings->registerPlugin($plugin["name"], $pInfo["perms"]);
$trks = rRetrackers::load();
$jResult .= $trks->get();
} else {
$jResult .= "plugin.disable(); noty('retrackers: '+theUILang.pluginCantStart,'error');";
}
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:11,代码来源:init.php
示例15: rXMLRPCRequest
<?php
$req = new rXMLRPCRequest(array(rTorrentSettings::get()->getOnFinishedCommand(array('xmpp' . getUser(), getCmd('cat=')))));
$req->run();
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:4,代码来源:done.php
示例16: eval
<?php
eval(getPluginConf($plugin["name"]));
require_once '../plugins/trafic/ratios.php';
$st = getSettingsPath();
makeDirectory(array($st . '/trafic', $st . '/trafic/trackers', $st . '/trafic/torrents'));
$req = new rXMLRPCRequest($theSettings->getScheduleCommand("trafic", $updateInterval, getCmd('execute') . '={sh,-c,' . escapeshellarg(getPHP()) . ' ' . escapeshellarg($rootPath . '/plugins/trafic/update.php') . ' ' . escapeshellarg(getUser()) . ' & exit 0}'));
if ($req->run() && !$req->fault) {
$theSettings->registerPlugin($plugin["name"], $pInfo["perms"]);
} else {
$jResult .= "plugin.disable(); noty('trafic: '+theUILang.pluginCantStart,'error');";
}
$jResult .= "plugin.collectStatForTorrents = " . ($collectStatForTorrents ? "true;" : "false;");
$jResult .= "plugin.updateInterval = " . $updateInterval . ";";
$jResult .= "plugin.disableClearButton = " . ($disableClearButton ? "true" : "false") . ";";
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:15,代码来源:init.php
示例17: setHandlers
public function setHandlers()
{
global $rootPath;
$throttleRulesExist = false;
$ratioRulesExist = false;
foreach ($this->lst as $item) {
if ($item->ratio != '') {
$ratioRulesExist = true;
}
if ($item->channel != '') {
$throttleRulesExist = true;
}
}
if ($ratioRulesExist) {
eval(getPluginConf('ratio'));
$insCmd = '';
for ($i = 0; $i < MAX_RATIO; $i++) {
$insCmd .= getCmd('d.views.has=') . 'rat_' . $i . ',,';
}
$ratCmd = getCmd('d.set_custom') . '=x-extratio1,"$' . getCmd('execute_capture') . '={' . getPHP() . ',' . $rootPath . '/plugins/extratio/update.php,\\"$' . getCmd('t.multicall') . '=$' . getCmd('d.get_hash') . '=,' . getCmd('t.get_url') . '=,' . getCmd('cat') . '=#\\",$' . getCmd('d.get_custom1') . '=,ratio,' . getUser() . '}" ; ' . getCmd('branch') . '=$' . getCmd('not') . '=$' . getCmd('d.get_custom') . '=x-extratio1,,' . $insCmd . getCmd('view.set_visible') . '=$' . getCmd('d.get_custom') . '=x-extratio1';
} else {
$ratCmd = getCmd('cat=');
}
if ($throttleRulesExist) {
$thrCmd = getCmd('d.set_custom') . '=x-extratio2,"$' . getCmd('execute_capture') . '={' . getPHP() . ',' . $rootPath . '/plugins/extratio/update.php,\\"$' . getCmd('t.multicall') . '=$' . getCmd('d.get_hash') . '=,' . getCmd('t.get_url') . '=,' . getCmd('cat') . '=#\\",$' . getCmd('d.get_custom1') . '=,channel,' . getUser() . '}" ; ' . getCmd('branch') . '=$' . getCmd('not') . '=$' . getCmd('d.get_custom') . '=x-extratio2,,' . getCmd('d.set_throttle_name') . '=$' . getCmd('d.get_custom') . '=x-extratio2';
} else {
$thrCmd = getCmd('cat=');
}
$req = new rXMLRPCRequest(array(rTorrentSettings::get()->getOnInsertCommand(array('_exratio1' . getUser(), $ratCmd)), rTorrentSettings::get()->getOnInsertCommand(array('_exratio2' . getUser(), $thrCmd))));
return $req->success();
}
开发者ID:byte916,项目名称:ruTorrent,代码行数:31,代码来源:rules.php
示例18: setHandlers
public function setHandlers()
{
if (rTorrentSettings::get()->linkExist) {
$req = new rXMLRPCRequest($this->hasAuto() ? rTorrentSettings::get()->getScheduleCommand("loginmgr", 1440, getCmd('execute') . '={sh,-c,' . escapeshellarg(getPHP()) . ' ' . escapeshellarg(dirname(__FILE__) . '/update.php') . ' ' . escapeshellarg(getUser()) . ' & exit 0}') : rTorrentSettings::get()->getRemoveScheduleCommand("loginmgr"));
$req->success();
}
}
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:7,代码来源:accounts.php
示例19: deleteTrackers
} else {
$needToProcessed = false;
}
}
$lst = $torrent->announce_list();
if ($lst && count($trks->todelete)) {
$needToProcessed = deleteTrackers($lst, $trks->todelete);
if ($needToProcessed) {
$torrent->announce_list($lst);
}
}
if ($needToProcessed) {
if (isset($torrent->{'rtorrent'})) {
unset($torrent->{'rtorrent'});
}
$eReq = new rXMLRPCRequest(new rXMLRPCCommand("d.erase", $hash));
if ($eReq->success()) {
$label = rawurldecode($req->val[3]);
rTorrent::sendTorrent($torrent, $isStart, false, $req->val[4], $label, false, false, false, array(getCmd("d.set_custom3") . "=1"));
$processed = true;
}
}
}
}
}
if (!$processed && $isStart) {
$req = new rXMLRPCRequest(new rXMLRPCCommand("d.start", $hash));
$req->run();
}
}
}
开发者ID:NetOverflow,项目名称:ruTorrent,代码行数:31,代码来源:update.php
示例20: getTorrents
public function getTorrents($rss, $url, $isStart, $isAddPath, $directory, $label, $throttle, $ratio, $needFlush = true)
{
$thash = 'Failed';
$ret = $rss->getTorrent($url);
if ($ret !== false) {
$addition = array();
if (!empty($throttle)) {
$addition[] = getCmd("d.set_throttle_name=") . $throttle;
}
if (!empty($ratio)) {
$addition[] = getCmd("view.set_visible=") . $ratio;
}
global $saveUploadedTorrents;
$thash = $ret === 'magnet' ? rTorrent::sendMagnet($url, $isStart, $isAddPath, $directory, $label, $addition) : rTorrent::sendTorrent($ret, $isStart, $isAddPath, $directory, $label, $saveUploadedTorrents, false, true, $addition);
if ($thash === false) {
$thash = 'Failed';
@unlink($ret);
$ret = false;
}
}
if ($ret === false) {
$this->rssList->addError("theUILang.rssCantLoadTorrent", $url);
}
$this->history->add($url, $thash, $rss->getItemTimestamp($url));
if ($needFlush) {
$this->saveHistory();
}
}
开发者ID:chaitanya11,项目名称:rtorrent,代码行数:28,代码来源:rss.php
注:本文中的getCmd函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论