mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-05-24 02:25:22 +00:00
增加IDE注释
This commit is contained in:
parent
b0607dbcf0
commit
32e14f9471
@ -10,4 +10,5 @@ namespace IYUU\Client;
|
||||
|
||||
interface AbstractClientInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -131,10 +131,40 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
const RPC_LT_14_TR_STATUS_SEED = 8;
|
||||
const RPC_LT_14_TR_STATUS_STOPPED = 16;
|
||||
|
||||
/**
|
||||
* Takes the connection parameters
|
||||
*
|
||||
* TODO: Sanitize username, password, and URL
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*/
|
||||
public function __construct($url = 'http://localhost:9091/transmission/rpc', $username = null, $password = null, $return_as_array = false)
|
||||
{
|
||||
// server URL
|
||||
$this->url = $url;
|
||||
|
||||
// Username & password
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
|
||||
// Get the Transmission RPC_version
|
||||
$this->rpc_version = self::sget()->arguments->rpc_version;
|
||||
|
||||
// Return As Array
|
||||
$this->return_as_array = $return_as_array;
|
||||
|
||||
// Reset X-Transmission-Session-Id so we (re)fetch one
|
||||
$this->session_id = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start one or more torrents
|
||||
*
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function start($ids)
|
||||
{
|
||||
@ -149,6 +179,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
* Stop one or more torrents
|
||||
*
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function stop($ids)
|
||||
{
|
||||
@ -163,6 +195,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
* Reannounce one or more torrents
|
||||
*
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function reannounce($ids)
|
||||
{
|
||||
@ -177,6 +211,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
* Verify one or more torrents
|
||||
*
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function verify($ids)
|
||||
{
|
||||
@ -225,6 +261,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
* "result": "success",
|
||||
* "tag": 39693
|
||||
* }
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function get($ids = array(), $fields = array())
|
||||
{
|
||||
@ -263,6 +301,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
*
|
||||
* @param array arguments An associative array of arguments to set
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function set($ids = array(), $arguments = array())
|
||||
{
|
||||
@ -345,6 +385,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
*
|
||||
* @param bool delete_local_data Also remove local data?
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function remove($ids, $delete_local_data = false)
|
||||
{
|
||||
@ -364,6 +406,8 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
* @param int|array ids A list of transmission torrent ids
|
||||
* @param string target_location The new storage location
|
||||
* @param string move_existing_data Move existing data or scan new location for available data
|
||||
* @return mixed
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function move($ids, $target_location, $move_existing_data = true)
|
||||
{
|
||||
@ -653,6 +697,7 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
* and store it in $this->session_id
|
||||
*
|
||||
* @return string
|
||||
* @throws TransmissionRPCException
|
||||
*/
|
||||
public function GetSessionID()
|
||||
{
|
||||
@ -713,32 +758,4 @@ class TransmissionRPC implements AbstractClientInterface
|
||||
}
|
||||
return $this->session_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes the connection parameters
|
||||
*
|
||||
* TODO: Sanitize username, password, and URL
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*/
|
||||
public function __construct($url = 'http://localhost:9091/transmission/rpc', $username = null, $password = null, $return_as_array = false)
|
||||
{
|
||||
// server URL
|
||||
$this->url = $url;
|
||||
|
||||
// Username & password
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
|
||||
// Get the Transmission RPC_version
|
||||
$this->rpc_version = self::sget()->arguments->rpc_version;
|
||||
|
||||
// Return As Array
|
||||
$this->return_as_array = $return_as_array;
|
||||
|
||||
// Reset X-Transmission-Session-Id so we (re)fetch one
|
||||
$this->session_id = null;
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
{
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"owner888/phpspider": "^2.1",
|
||||
"curl/curl": "^2.2"
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-curl": "*",
|
||||
"owner888/phpspider": "^2.1",
|
||||
"curl/curl": "^2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"IYUU\\": "app/"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"IYUU\\": "app/"
|
||||
},
|
||||
"files": ["app/helper.php"]
|
||||
}
|
||||
"files": ["app/helper.php"]
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user