コード例 #1
0
ファイル: getTorrents.php プロジェクト: nip3o/Transweb
<?php

require_once dirname(__FILE__) . "/classes/RPCConnection.class.php";
$rpc = new RPCConnection();
echo $rpc->getAllTorrents();
コード例 #2
0
ファイル: addTorrent.php プロジェクト: nip3o/Transweb
<?php

require_once dirname(__FILE__) . "/../../php/classes/RPCConnection.class.php";
$rpc = new RPCConnection();
switch ($_POST["method"]) {
    case 'addTorrentURL':
        echo $rpc->addTorrentByUrl($_POST["url"], $_POST["path"]);
        break;
    case 'addTorrentFile':
        $torrentContent = file_get_contents($_FILES['torrent']['tmp_name']);
        echo $rpc->addTorrentByRaw($torrentContent, $_POST["path"]);
        break;
    default:
        echo '<pre>';
        print_r($_FILES);
        echo '</pre>';
        break;
}
コード例 #3
0
<?php

require_once dirname(__FILE__) . "/classes/RPCConnection.class.php";
$rpc = new RPCConnection();
echo $rpc->getTransmissionSession();