Example #1
0
 public static function addRtorrentServeur1($nom, $host)
 {
     $rtorrent = new Rtorrent();
     $rtorrent->nom = $nom;
     $rtorrent->hostname = $host;
     return $rtorrent->insert();
 }
Example #2
0
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
//Add our includes
require_once 'lib/rtorrent.php';
require_once 'settings.php';
//Die if we cant find appropriate settings
if (!$configuration['server_ip']) {
    json_encode(array('error' => 'Settings file not found'));
    die;
}
//Initiate our object
if (strtolower($configuration['server_type']) == 'rtorrent') {
    $server = new Rtorrent($configuration);
}
//This is our switch, depending on the action, depends on the function we run:
switch ($_GET['action']) {
    case 'retrieve':
        $contents = $server->Retrieve();
        break;
    case 'debug':
        $contents = $server->Debug();
        break;
    case 'pause':
        //Does the id have the magic id of all?
        if ($_GET['id'] == 'all') {
            $contents = $server->PauseAll();
        } else {
            $contents = $server->Pause($_GET['id']);