Exemplo n.º 1
0
<?php

##### Initialization #####
require_once "torrentClient.php";
$client = new torrentClient();
$uploadDir = $client->getUploadDir();
##### Initialization #####
##### Panel Control #####
if (isset($_POST["start"])) {
    if ($client->start()) {
        echo "Rtorrent started";
    } else {
        echo "Rtorrent already started";
    }
}
if (isset($_POST["stop"])) {
    if ($client->stop()) {
        echo "Rtorrent stopped";
    } else {
        echo "There is no rtorrent client to stop";
    }
}
if (isset($_POST["check"])) {
    if ($client->check()) {
        if ($client->countTorrentFile() >= 1) {
            echo display();
        } else {
            echo "No torrent file(s) found";
        }
    } else {
        echo "Rtorrent not started";
Exemplo n.º 2
0
<?php

require_once "torrentClient.php";
$client = new torrentClient();
$client->getUploadDir();
$client->start();
echo $client->listScreen() . "\n";
echo $client->countTorrentFile();
echo $client->checkTorrentExt("HOBBIT:THE DESOLATION OF SMAUG.torrent");
echo $client->validateTorrentFile("/var/www/html/phoe721.com/project/bt/upload/test.torrent");
echo $client->validateTorrentFile("/var/www/html/phoe721.com/project/bt/upload/a");
echo $client->removeTorrentFile("/var/www/html/phoe721.com/project/bt/upload/a");
echo $client->checkFileType("application/x-bittorrent");
echo $client->checkFileType("application/abc");
$client->stop();