2017 © Pedro Peláez
 

library transmission

Awesome PHP JSON-RPC client library for Transmission

image

vohof/transmission

Awesome PHP JSON-RPC client library for Transmission

  • Thursday, June 12, 2014
  • by vohof
  • Repository
  • 6 Watchers
  • 16 Stars
  • 655 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 7 Versions
  • 3 % Grown

The README.md

PHP Transmission RPC Client

A fully-tested PHP JSON-RPC client library for Transmission, (*1)

Build Status, (*2)

Table of Contents

Installation

Install through Composer:, (*3)

{
  "require": {
    "vohof/transmission": "1.0.*"
  }
}

Example Usage

$config = array(
    'host'     => 'http://127.0.0.1',
    'endpoint' => '/transmission/rpc',
    'username' => 'foo', // Optional
    'password' => 'bar' // Optional
);

$transmission = new Vohof\Transmission($config);

// Add a torrent
$torrent = $transmission->add('magnet:?xt=urn:btih:335990d615594b9be409ccfeb95864e24ec702c7&dn=Ubuntu+12.10+Quantal+Quetzal+%2832+bits%29&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337');

// or
$content = base64_encode(file_get_contents('MyTorrent.torrent'));
$torrent = $transmission->add($content, true);

// Stop a torrent
$transmission->action('stop', $torrent['id']);

// Limit download speed
$transmission->set($torrent['id'], array('downloadLimit' => 100));

// Get torrent size
$transmission->get($torrent['id'], array('totalSize'));

// Remove torrent
$transmission->remove($torrent['id']););

// Remove torrent and its files
$transmission->remove($torrent['id'], true);

// Stats
$transmission->getStats();

See the tests for more usage, (*4)

Use Transmission with Laravel

Add the service provider and alias the package in config/app.php, (*5)

'providers' => array(
    ...
    'Vohof\TransmissionServiceProvider'
),
'aliases' => array(
    ...
    'Transmission' => 'Vohof\TransmissionFacade'
)

Publish config and modify app/config/packages/transmission/config.php, (*6)

$ php artisan config:publish transmission --path=vendor/vohof/transmission/src/config

Use the library:, (*7)

Transmission::add($base64EncodedTorrent, true);
Torrent::stats();

Advanced

The library uses Guzzle as it's HTTP Client but you can choose to swap it with something else if you want (eg. Buzz), (*8)

class BuzzClient extends \Vohof\ClientAbstract {
    ...
}

$transmission = new Vohof\Transmission($config, new BuzzClient);

To-Do

  • torrent-rename-path, blocklist-update

License

See LICENSE, (*9)

The Versions

12/06 2014

dev-master

9999999-dev

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

 

The Development Requires

laravel json-rpc transmission rpc

01/08 2013

dev-feature/no-error-on-no-success-flag

dev-feature/no-error-on-no-success-flag

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

 

The Development Requires

laravel json-rpc transmission rpc

01/08 2013

v1.0.3

1.0.3.0

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

 

The Development Requires

laravel json-rpc transmission rpc

29/07 2013

dev-feature/extend-guzzle-exceptions

dev-feature/extend-guzzle-exceptions

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

 

The Development Requires

laravel json-rpc transmission rpc

23/07 2013

v1.0.2

1.0.2.0

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

 

The Development Requires

laravel json-rpc transmission rpc

21/07 2013

v1.0.1

1.0.1.0

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

 

The Development Requires

laravel json-rpc transmission rpc

21/07 2013

v1.0.0

1.0.0.0

Awesome PHP JSON-RPC client library for Transmission

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

laravel json-rpc transmission rpc