ABCProtocol is an abstraction layer to the ABC web interface service (2.7 version)
This property is set when a command is sent
This property is set when an error occurs
ERROR_PROTOCOL errors do not have an error number
This property is set when an error occurs
This property is set when an error occurs
Constructor that defines constants and sets the default class properties
Adds a single torrent
Supports setting a save location ONLY IF set parameters and get parameters are enabled in ABC for the web service (disabled by default).
Example Code
- $abc->add_torrent( 'http://file1.torrent' );
- $abc->add_torrent( 'http://file1.torrent', 'C:\\Downloads\\' );
Adds a list of torrents
List of Torrent URLs
List of Torrent URLs with Save Location
- $abc->add_torrents_list( array( 'http://file1.torrent', 'http://file2.torrent' ) );
Supports setting a save location ONLY IF set parameters and get parameters are enabled in ABC for the web service (disabled by default)
- $abc->add_torrents_list( array(
- array( 'http://file1.torrent', '/path/to/save/1' ),
- array( 'http://file2.torrent', '/path/to/save/2' ) ),
- );
Closes ABC's web service
Remember that once you close the web service, there isn't a protocol-based way to get it back up!
Example Code
- $abc->close();
Deletes torrent(s)
Instead of passing an array of torrent hashes, you may also send the following constants:
- $abc->delete_torrents( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
- $abc->delete_torrents( 'abcdef01234569abcdef01234569abc1' );
- $abc->delete_torrents( ALL );
- $abc->delete_torrents( COMPLETED );
Gets language string from ABC
If you request an inexistant language string from ABC, ABC will popup a message box on the server for the first time that will state that an outdated language file is being used.
Example Code
- print_r( $abc->get_lang_strings( array(
- 'superseederrornotcompleted',
- 'superwarningmsg_line2',
- ) ) );
- print_r( $abc->get_lang_strings( 'superseederrornotcompleted' ) );
Gets ABC parameter(s)
Example Code
- echo $abc->get_params( array( 'window_width', 'maxdownloadrate' ) );
- echo $abc->get_params( 'window_width' );
Pauses torrent(s)
Instead of passing an array of torrent hashes, you may also send the following constants:
- $abc->pause_torrents( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
- $abc->pause_torrents( 'abcdef01234569abcdef01234569abc1' );
- $abc->pause_torrents( ALL );
- $abc->pause_torrents( COMPLETED );
Queries ABC for a list of torrents
Pass an array of fields. If no fields are passed, a default set of fields will be passed.
Note: Do not trust that the order of fields you send are received in the same order (especially if you send repeat fields)
List of Fields (these are constants)
Example Results (outputted with print_r())
The key names appear as numbers but you can use $result[0][COL_TORRENT_NAME] or respectively.
- Array
- (
- [0] => Array
- (
- [4] => [AonE]_Naruto_142_[A96A4B42].avi
- [5] => 100.0%
- )
- )Array
- (
- [0] => Array
- (
- [4] => [AonE]_Naruto_142_[A96A4B42].avi
- [5] => 100.0%
- [6] => stop
- [8] =>
- [10] =>
- [11] =>
- [12] => 49.7%
- [15] => 0 (388)
- [14] => 0 (531)
- [16] =>
- [18] => 174.29 MB
- [19] => 86.59 MB
- [17] =>
- [20] =>
- [99] => c6ef01d7f1fa5d458e31a37457fead490dfb7bf5
- )
- )
Queues torrent(s)
Instead of passing an array of torrent hashes, you may also send the following constants:
- $abc->queue_torrents( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
- $abc->queue_torrents( 'abcdef01234569abcdef01234569abc1' );
- $abc->queue_torrents( ALL );
- $abc->queue_torrents( COMPLETED );
Resumes torrent(s)
Instead of passing an array of torrent hashes, you may also send the following constants:
- $abc->resume_torrents( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
- $abc->resume_torrents( 'abcdef01234569abcdef01234569abc1' );
- $abc->resume_torrents( ALL );
- $abc->resume_torrents( COMPLETED );
Sends a command to ABC
If there is an error, the error properties of this class will be updated to reflect the error and FALSE will be returned.
Example Code
- $abc->send_command( 'CLOSE|' );
Set ABC parameters
Will return FALSE if one command does not go through.
Note: For each parameter, a new command will be sent. When all the parameters were sent at once, the error Command should end with | kept appearing and a solution could not be found.
Example Code
- $abc->set_params( array( 'window_width' => 500 ) );
Sets priorities of torrents
Example Code
Piorities range from 0 to 4; use info hashes to identify torrents
- $abc->set_torrent_priorities( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
Stops torrent(s)
Instead of passing an array of torrent hashes, you may also send the following constants:
- $abc->stop_torrents( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
- $abc->stop_torrents( 'abcdef01234569abcdef01234569abc1' );
- $abc->stop_torrents( ALL );
- $abc->stop_torrents( COMPLETED );
Unpauses torrent(s)
Instead of passing an array of torrent hashes, you may also send the following constants:
- $abc->unpause_torrents( array(
- 'abcdef01234569abcdef01234569abc1' => 4,
- 'abcdef01234569abcdef01234569abc2' => 2,
- ) );
- $abc->unpause_torrents( 'abcdef01234569abcdef01234569abc1' );
- $abc->unpause_torrents( ALL );
- $abc->unpause_torrents( COMPLETED );
Gets current version of ABC installed
Example Code
- echo $abc->version();
Documentation generated on Fri, 22 Jul 2005 19:04:10 -0700 by phpDocumentor 1.3.0RC3