Compare commits

..

2 commits

Author SHA1 Message Date
ecb6b89518 Change api.t411.li to api.t411.ai 2017-03-25 22:14:50 +01:00
f174796f74 API domain updated 2016-11-21 01:35:25 +01:00
3 changed files with 2 additions and 70 deletions

View file

@ -13,7 +13,7 @@ class Client
public function __construct()
{
$this->client = new GuzzleClient(['base_url' => 'https://api.t411.ch']);
$this->client = new GuzzleClient(['base_url' => 'https://api.t411.ai']);
}
public function getAuthorization($username, $password)

View file

@ -8,9 +8,9 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Command\Command;
use Api\ConfigLoader;
use Symfony\Component\Console\Input\ArrayInput;
use Vohof\Transmission;
use Transmission\Client\GuzzleClient;
use Helper\Formater;
use Transmission\Transmission;
class TransmissionStatsCommand extends Command
{

View file

@ -1,68 +0,0 @@
<?php
namespace Transmission;
use Vohof\Transmission as BaseTransmission;
use Vohof\ClientAbstract;
/**
* Class doo
* @author Simon Vieille <simon@deblan.fr>
*/
class Transmission extends BaseTransmission
{
public function __construct(array $config, ClientAbstract $client = null)
{
parent::__construct($config, $client);
$this->config = $config;
foreach(array('host', 'endpoint') as $requirement)
{
if ( ! isset($config[$requirement]))
{
throw new \InvalidArgumentException("Missing argument: $requirement");
}
}
if (is_null($client))
{
$options = array();
if (isset($config['username']) and isset($config['password']))
{
$options = array(
'request.options' => array(
'auth' => array($config['username'], $config['password'])
)
);
}
$this->client = new GuzzleClient($config['host'], $options);
}
else
{
$this->client = $client;
}
$this->client->setEndpoint($config['endpoint']);
}
// public function add($url, $isEncoded = false, $options = array())
// {
// $options[$isEncoded ? 'metainfo' : 'filename'] = $url;
// return $this->client->request('torrent-add', $options);
// }
// public function foo()
// {
// $options = [
// 'fields' => static::$fields,
// 'ids' => ['all'],
// ];
//
// return $this->client->request('torrent-get', $options);
// }
}