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"; } } ##### Panel Control ##### ##### Torrent Control ##### if (isset($_POST["torrentHash"])) { $torrentHash = $_POST["torrentHash"]; if (isset($_POST["startTorrent"])) { echo $client->startTorrent($torrentHash); } else {
<?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();