antonyartsev/transmission

There is no license information available for the latest version (dev-master) of this package.

Package

dev-master 2018-06-14 04:12 UTC

README

Transmission for yii2 (forked PHP-Transmission-Class)

Install

Composer

composer require antonyartsev/transmission

Use

Init

use antonyartsev\transmission\Transmission;

$torrents = new Transmission ();
$torrents = new Transmission ("host", "user", "password");

(new Transmission without param - connect to localhost:9091, no auth)

Init with Yii Key-Value storage

use antonyartsev\transmission\Transmission;
use antonyartsev\transmission\TransmissionAuth;

$torrents = new Transmission ();
$torrents = new Transmission ("host", TransmissionAuth::get_transmission_user(), TransmissionAuth::get_transmission_password());

In key-value: transmission_user - user transmission_password - password

Get

$torrents->return_as_array = true; //return array, otherwise obj.
$torrents->get(); //get all
//or
$torrents->get($id, array('files')); //get torrent by id with custom rows

Add

$torrents->add($torrent_url, '/path' );

Start

$torrents->start($id);

Stop

$torrents->stop($id);

Remove

$torrents->remove($id, false); //true - delete local data