本文整理汇总了PHP中getPHP函数的典型用法代码示例。如果您正苦于以下问题:PHP getPHP函数的具体用法?PHP getPHP怎么用?PHP getPHP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPHP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setHandlers
public function setHandlers()
{
$theSettings = rTorrentSettings::get();
$pathToXmpp = dirname(__FILE__);
$req = new rXMLRPCRequest();
if ($this->message !== '' && isset($this->jabberServer) && isset($this->jabberLogin) && isset($this->jabberPasswd) && isset($this->jabberFor)) {
$cmd = $theSettings->getOnFinishedCommand(array('xmpp' . getUser(), getCmd('execute.nothrow.bg') . '={' . getPHP() . ',' . $pathToXmpp . '/notify.php,"$' . getCmd('d.name') . '=","' . getUser() . '"}'));
} else {
$cmd = $theSettings->getOnFinishedCommand(array('xmpp' . getUser(), getCmd('cat=')));
}
$req->addCommand($cmd);
return $req->success();
}
示例2: file_get_contents
<?php
require_once "../../php/util.php";
if (!isset($HTTP_RAW_POST_DATA)) {
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
}
$ret = array();
if (isset($HTTP_RAW_POST_DATA)) {
$vars = explode('&', $HTTP_RAW_POST_DATA);
foreach ($vars as $var) {
$parts = explode("=", $var);
if ($parts[0] == "hash") {
$ret[] = $parts[1];
}
}
if (count($ret)) {
$fname = getTempDirectory() . 'rutorrent-prm-' . getUser() . time();
file_put_contents($fname, serialize($ret));
shell_exec(getPHP() . " -f " . escapeshellarg(dirname(__FILE__) . "/batch_check.php") . " " . escapeshellarg($fname) . " " . getUser() . " > /dev/null 2>&1 &");
// shell_exec( getPHP()." -f ".escapeshellarg(dirname( __FILE__)."/batch_check.php")." ".escapeshellarg($fname)." ".getUser()." > /tmp/1 2>/tmp/2 &" );
}
}
cachedEcho('{}', "application/json");
示例3: 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();
}
示例4: 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();
}
示例5: log
if (isset($_REQUEST['piece_size'])) {
$piece_size = $_REQUEST['piece_size'] * 1024;
}
if (!$pathToCreatetorrent || $pathToCreatetorrent == "") {
$pathToCreatetorrent = $useExternal;
}
if ($useExternal == "mktorrent") {
$piece_size = log($piece_size, 2);
} else {
if ($useExternal === false) {
$useExternal = "inner";
}
}
$task = new rTask(array('arg' => call_user_func('getFileName', $path_edit), 'requester' => 'create', 'name' => 'create', 'path_edit' => $_REQUEST['path_edit'], 'trackers' => $_REQUEST['trackers'], 'comment' => $_REQUEST['comment'], 'start_seeding' => $_REQUEST['start_seeding'], 'piece_size' => $_REQUEST['piece_size'], 'private' => $_REQUEST['private']));
$commands = array();
$commands[] = escapeshellarg($rootPath . '/plugins/create/' . $useExternal . '.sh') . " " . $task->id . " " . escapeshellarg(getPHP()) . " " . escapeshellarg($pathToCreatetorrent) . " " . escapeshellarg($path_edit) . " " . $piece_size . " " . escapeshellarg(getUser()) . " " . escapeshellarg(rTask::formatPath($task->id));
$commands[] = '{';
$commands[] = 'chmod a+r "${dir}"/result.torrent';
$commands[] = '}';
$ret = $task->start($commands, 0);
break;
} else {
$error = 'Incorrect directory (' . mb_substr($path_edit, mb_strlen($topDirectory) - 1) . ')';
}
}
$ret = array("no" => -1, "pid" => 0, "status" => 255, "log" => array(), "errors" => array($error));
break;
case "getfile":
$dir = rTask::formatPath($_REQUEST['no']);
$torrent = new Torrent($dir . "/result.torrent");
if (!$torrent->errors()) {
示例6: eval
if (!chdir(dirname(__FILE__))) {
exit;
}
if (count($argv) > 1) {
$usr = $argv[1] == '--daemon' ? 3 : 2;
if (count($argv) > $usr) {
$_SERVER['REMOTE_USER'] = $argv[$usr];
}
}
require_once "./util_rt.php";
require_once "./autotools.php";
eval(getPluginConf('autotools'));
// If we are not in background, run this script in background
array_shift($argv);
if (!rtIsDaemon($argv)) {
rtDaemon(getPHP(), basename(__FILE__), $argv);
// script was exited at the line above
}
// arguments array was shifted and "--daemon" param was added, so:
// 0: --daemon
// 1: hash
// 2: username
$AutoLabel_Sem = rtSemGet(fileinode(__FILE__));
rtSemLock($AutoLabel_Sem);
function Debug($str)
{
global $autodebug_enabled;
if ($autodebug_enabled) {
rtDbg("AutoLabel", $str);
}
}
示例7: 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") . ";";
示例8: setHandlers
public function setHandlers()
{
$startAt = 0;
$req = new rXMLRPCRequest(rTorrentSettings::get()->getScheduleCommand("rss", $this->data->interval, getCmd('execute') . '={sh,-c,' . escapeshellarg(getPHP()) . ' ' . escapeshellarg(dirname(__FILE__) . '/update.php') . ' ' . escapeshellarg(getUser()) . ' & exit 0}', $startAt));
if ($req->success()) {
$this->setStartTime($startAt);
return true;
}
return false;
}
示例9: setHandlers
public function setHandlers()
{
global $checkTimesInterval;
$req = new rXMLRPCRequest($this->hasTimes() ? rTorrentSettings::get()->getScheduleCommand("ratio", $checkTimesInterval, getCmd('execute') . '={sh,-c,' . escapeshellarg(getPHP()) . ' ' . escapeshellarg(dirname(__FILE__) . '/update.php') . ' ' . escapeshellarg(getUser()) . ' & exit 0}') : rTorrentSettings::get()->getRemoveScheduleCommand("ratio"));
return $req->success();
}
示例10: 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();
}
}
示例11: 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();
}
示例12: 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');";
}
示例13: chmod
chmod($randName, 0644);
$piece_size = 262144;
if (isset($_REQUEST['piece_size'])) {
$piece_size = $_REQUEST['piece_size'] * 1024;
}
if (!$pathToCreatetorrent || $pathToCreatetorrent == "") {
$pathToCreatetorrent = $useExternal;
}
if ($useExternal == "mktorrent") {
$piece_size = log($piece_size, 2);
} else {
if ($useExternal === false) {
$useExternal = "inner";
}
}
$req = new rXMLRPCRequest(new rXMLRPCCommand("execute", array("sh", "-c", escapeshellarg($rootPath . '/plugins/create/' . $useExternal . '.sh') . " " . $taskNo . " " . escapeshellarg(getPHP()) . " " . escapeshellarg($pathToCreatetorrent) . " " . escapeshellarg($path_edit) . " " . $piece_size . " " . escapeshellarg(getUser()) . " " . escapeshellarg(getTempDirectory()) . " &")));
if ($req->success()) {
$ret = array("no" => intval($taskNo), "errors" => array(), "status" => -1, "out" => "");
}
} else {
$error = 'theUILang.incorrectDirectory';
}
}
break;
case "check":
if (isset($_REQUEST['no'])) {
$taskNo = $_REQUEST['no'];
$dir = getTempDirectory() . getUser() . $taskNo;
if (is_file($dir . '/pid') && is_readable($dir . '/pid')) {
$pid = trim(file_get_contents($dir . '/pid'));
$status = -1;
示例14: 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');";
}
示例15: setHandlers
public function setHandlers()
{
global $rootPath;
if ($this->log["addition"] || $this->log["pushbullet_enabled"] && $this->log["pushbullet_addition"]) {
$addCmd = getCmd('execute') . '={' . getPHP() . ',' . $rootPath . '/plugins/history/update.php' . ',1,$' . getCmd('d.get_name') . '=,$' . getCmd('d.get_size_bytes') . '=,$' . getCmd('d.get_bytes_done') . '=,$' . getCmd('d.get_up_total') . '=,$' . getCmd('d.get_ratio') . '=,$' . getCmd('d.get_creation_date') . '=,$' . getCmd('d.get_custom') . '=addtime,$' . getCmd('d.get_custom') . '=seedingtime' . ',"$' . getCmd('t.multicall') . '=$' . getCmd('d.get_hash') . '=,' . getCmd('t.get_url') . '=,' . getCmd('cat') . '=#",$' . getCmd('d.get_custom1') . "=,\$" . getCmd('d.get_custom') . "=x-pushbullet," . getUser() . '}';
} else {
$addCmd = getCmd('cat=');
}
if ($this->log["finish"] || $this->log["pushbullet_enabled"] && $this->log["pushbullet_finish"]) {
$finCmd = getCmd('execute') . '={' . getPHP() . ',' . $rootPath . '/plugins/history/update.php' . ',2,$' . getCmd('d.get_name') . '=,$' . getCmd('d.get_size_bytes') . '=,$' . getCmd('d.get_bytes_done') . '=,$' . getCmd('d.get_up_total') . '=,$' . getCmd('d.get_ratio') . '=,$' . getCmd('d.get_creation_date') . '=,$' . getCmd('d.get_custom') . '=addtime,$' . getCmd('d.get_custom') . '=seedingtime' . ',"$' . getCmd('t.multicall') . '=$' . getCmd('d.get_hash') . '=,' . getCmd('t.get_url') . '=,' . getCmd('cat') . '=#",$' . getCmd('d.get_custom1') . "=,\$" . getCmd('d.get_custom') . "=x-pushbullet," . getUser() . '}';
} else {
$finCmd = getCmd('cat=');
}
if ($this->log["deletion"] || $this->log["pushbullet_enabled"] && $this->log["pushbullet_deletion"]) {
$delCmd = getCmd('execute') . '={' . getPHP() . ',' . $rootPath . '/plugins/history/update.php' . ',3,$' . getCmd('d.get_name') . '=,$' . getCmd('d.get_size_bytes') . '=,$' . getCmd('d.get_bytes_done') . '=,$' . getCmd('d.get_up_total') . '=,$' . getCmd('d.get_ratio') . '=,$' . getCmd('d.get_creation_date') . '=,$' . getCmd('d.get_custom') . '=addtime,$' . getCmd('d.get_custom') . '=seedingtime' . ',"$' . getCmd('t.multicall') . '=$' . getCmd('d.get_hash') . '=,' . getCmd('t.get_url') . '=,' . getCmd('cat') . '=#",$' . getCmd('d.get_custom1') . "=,\$" . getCmd('d.get_custom') . "=x-pushbullet," . getUser() . '}';
} else {
$delCmd = getCmd('cat=');
}
$req = new rXMLRPCRequest(array(rTorrentSettings::get()->getOnInsertCommand(array('thistory' . getUser(), $addCmd)), rTorrentSettings::get()->getOnFinishedCommand(array('thistory' . getUser(), $finCmd)), rTorrentSettings::get()->getOnEraseCommand(array('thistory' . getUser(), $delCmd))));
return $req->success();
}