Location: PHPKode > scripts > ABC Protocol > abc-protocol/docs/ABCProtocol.html
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Docs For Class ABCProtocol</title> <style type='text/css'><!-- a, a:link, a:visited { color: #706271; text-decoration: underline; } a:hover, a:active { text-decoration: underline; background-color: #EFEFEF }  body, table { background-color: #FFFFFF; font-family: Verdana, Arial, sans-serif; font-size: 10pt } p, li { line-height: 140% } a img { border: 0px; } dd { margin-left: 0px; padding-left: 1em; }  /* Page layout/boxes */  .info-box { border-top: 1px solid #829191; margin-top: 4em; } .info-box-title { border-top: 4px solid #D8E7E7; font-size: 13pt; color: #3F4E4E; font-weight: bold; padding-top: 5px; letter-spacing: .1em; text-transform: uppercase; } .info-box-body { } .nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .5em; color: #BBBBBB; margin: 0em 0em 1em 0em; font-style: italic; }  .oddrow { border-top: 1px dotted #CCCCCC; padding-top: 1em; margin-bottom: 1em } .evenrow { border-top: 1px dotted #CCCCCC; padding-top: 1em; margin-bottom: 1em }  .page-body { max-width: 800px; margin: auto; } .tree {  }  .file-name, h1 { font-size: 16pt; color: #3F4E4E; font-weight: bold; text-align: left; }  /* Index formatting classes */  .index-item-body { margin-top: .5em; margin-bottom: .5em} .index-item-description { margin-top: .25em } .index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } .index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} .index-letter-title { font-size: 12pt; font-weight: bold } .index-letter-menu { text-align: center; margin: 1em } .index-letter { font-size: 12pt }  /* Docbook classes */  .description {} .short-description { font-weight: bold; color: #3F4E4E; } .tags {	padding-left: 0em; margin-left: 3em; list-style-type: square; } .parameters {	padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; } .redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } .package {  } .package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } .package-details { font-size: 85%; } .sub-package { font-weight: bold; font-size: 120% } .tutorial { border-width: thin; border-color: #0066ff } .tutorial-nav-box { width: 100%; border: 1px solid #AAAAAA; background-color: #DDDDFF; } .nav-button-disabled { color: #AAAAAA; } .nav-button:active, .nav-button:focus, .nav-button:hover { background-color: #CCCCCC; outline: 1px solid #999999; text-decoration: none } .folder-title { font-style: italic }  /* Generic formatting */  .field { font-weight: bold; } .detail { font-size: 8pt; } .notes { font-style: italic; font-size: 8pt; } .separator { background-color: #999999; height: 2px; } .warning {  color: #FF6600; } .disabled { font-style: italic; color: #999999; } #credit { margin-top: 10em }  /* Code elements */  .line-number {  }  code, code li { padding: 0; margin: 0; line-height: 100%; height: 4px; }  .class-table { width: 100%; } .class-table-header { border-bottom: 1px dotted #666666; text-align: left; background-color: DDDDFF } .class-name { font-size: 16pt; color: #3F4E4E; font-weight: bold; text-align: left; }  .method-summary { padding-left: 1em; font-size: 8pt } /*.method-header { background-color: #DDDDFF; padding: 1px; }*/ .method-definition { margin-bottom: .3em } .method-title { font-size: 13pt; font-weight: bold } .method-name { font-weight: bold; color: #3F4E4E;  } .method-signature { font-family: monospace; font-size: 11pt; color: #666666; margin: .5em 0em } .method-result { font-style: italic; }  .var-summary { padding-left: 1em; font-size: 8pt; } /*.var-header { background-color: #DDDDFF; padding: 1px; }*/ .var-title { margin-bottom: .3em } .var-type { font-style: italic; } .var-name { font-weight: bold } .var-header .var-name { font-size: 13pt; font-weight: bold } .var-default {} .var-description { font-weight: normal; color: #000000; }  .include-title {  } .include-type { font-style: italic; } .include-name { font-weight: bold; }  .const-title {  } .const-name { font-weight: bold; }  /* Syntax highlighting */  .src-code {  border: 1px solid #999999; padding: 1em; } *[class="src-code"], *[class="listing"], *[class="example"] { line-height : 0.5em }  .src-comm { color: green; } .src-id {  } .src-inc { color: #0000FF; } .src-key { color: #000000; font-weight: bold; } .src-num { color: #007F00; } .src-str { color: #0000FF; } .src-sym { font-weight: bold; } .src-var { color: #CA0005; }  .src-php { font-weight: bold; }  .src-doc { color: #009999 } .src-doc-close-template { color: #0000FF } .src-doc-coretag { color: #0099FF; font-weight: bold } .src-doc-inlinetag { color: #0099FF } .src-doc-internal { color: #6699cc } .src-doc-tag { color: #0080CC } .src-doc-template { color: #0000FF } .src-doc-type { font-style: italic } .src-doc-var { font-style: italic }  .tute-tag { color: #009999 } .tute-attribute-name { color: #0000FF } .tute-attribute-value { color: #0099FF } .tute-entity { font-weight: bold; } .tute-comment { font-style: italic } .tute-inline-tag { color: #636311; font-weight: bold }  /* tutorial */  .authors {  } .author { font-style: italic; font-weight: bold } .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } .ref-title-box {  } .ref-title {  } .ref-purpose { font-style: italic; color: #666666 } .ref-synopsis {  } .title { font-weight: bold; border: 2px solid #999999; background-color: #FFFFFF; padding: 2px } .cmd-synopsis { margin: 1em 0em } .cmd-title { font-weight: bold } .toc { margin-left: 2em; padding-left: 0em } --></style> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> </head> <body> <div class="page-body"> <h2 class="class-name">Class ABCProtocol</h2>  <a name="sec-description"></a> <div class="info-box"> <div class="info-box-title">Description</div> <div class="nav-bar"> <span class="disabled">Description</span> | <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>) |											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)  </div> <div class="info-box-body"> <!-- ========== Info from phpDoc block ========= --> <p class="short-description">ABCProtocol is an abstraction layer to the ABC web interface service (2.7 version)</p> <ul class="tags"> <li><span class="field">copyright:</span> Copyright (c) 2005, sk89q</li> <li><span class="field">link:</span> <a href="http://pingpong-abc.sourceforge.net/protocol_v3.txt">protocol documentation</a></li> <li><span class="field">link:</span> <a href="http://pingpong-abc.sourceforge.net">ABC [ Yet Another Bittorrent Client ] website</a></li> <li><span class="field">author:</span> sk89q</li> <li><span class="field">version:</span> 1.0 BETA</li> </ul>    </div> </div>    <a name="sec-var-summary"></a> <div class="info-box"> <div class="info-box-title">Variable Summary</span></div> <div class="nav-bar"> <a href="#sec-description">Description</a> | <span class="disabled">Vars</span> (<a href="#sec-vars">details</a>) | <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)  </div> <div class="info-box-body"> <div class="var-summary"> <div class="var-title"> <span class="var-type">string</span> <a href="#$host" title="details" class="var-name">$host</a> </div> <div class="var-title"> <span class="var-type">string</span> <a href="#$last_command" title="details" class="var-name">$last_command</a> </div> <div class="var-title"> <span class="var-type">integer</span> <a href="#$last_error_no" title="details" class="var-name">$last_error_no</a> </div> <div class="var-title"> <span class="var-type">string</span> <a href="#$last_error_str" title="details" class="var-name">$last_error_str</a> </div> <div class="var-title"> <span class="var-type">integer</span> <a href="#$last_error_type" title="details" class="var-name">$last_error_type</a> </div> <div class="var-title"> <span class="var-type">integer</span> <a href="#$port" title="details" class="var-name">$port</a> </div> <div class="var-title"> <span class="var-type">integer</span> <a href="#$timeout" title="details" class="var-name">$timeout</a> </div> <div class="var-title"> <span class="var-type">string</span> <a href="#$unique_key" title="details" class="var-name">$unique_key</a> </div> </div> </div> </div>  <a name="sec-method-summary"></a> <div class="info-box"> <div class="info-box-title">Method Summary</span></div> <div class="nav-bar"> <a href="#sec-description">Description</a> | <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)  | <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>) </div> <div class="info-box-body"> <div class="method-summary">  <div class="method-definition"> <span class="method-result">ABCProtocol</span> <a href="#ABCProtocol" title="details" class="method-name">ABCProtocol</a> ([<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'localhost'</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$port</span> = <span class="var-default">4000</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$unique_key</span> = <span class="var-default">''</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout</span> = <span class="var-default">5</span>]) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#add_torrent" title="details" class="method-name">add_torrent</a> (<span class="var-type">string</span>&nbsp;<span class="var-name">$torrent</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$location</span> = <span class="var-default">''</span>]) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#add_torrents_list" title="details" class="method-name">add_torrents_list</a> (<span class="var-type">array</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#close" title="details" class="method-name">close</a> () </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#delete_torrents" title="details" class="method-name">delete_torrents</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">mixed</span> <a href="#get_lang_strings" title="details" class="method-name">get_lang_strings</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$names</span>) </div>  <div class="method-definition"> <span class="method-result">mixed</span> <a href="#get_params" title="details" class="method-name">get_params</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$params</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#pause_torrents" title="details" class="method-name">pause_torrents</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">mixed</span> <a href="#query" title="details" class="method-name">query</a> ([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">array()</span>]) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#queue_torrents" title="details" class="method-name">queue_torrents</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#resume_torrents" title="details" class="method-name">resume_torrents</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#send_command" title="details" class="method-name">send_command</a> (<span class="var-type">string</span>&nbsp;<span class="var-name">$query</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#set_params" title="details" class="method-name">set_params</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$params</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#set_torrent_priorities" title="details" class="method-name">set_torrent_priorities</a> (<span class="var-type">array</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#stop_torrents" title="details" class="method-name">stop_torrents</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">bool</span> <a href="#unpause_torrents" title="details" class="method-name">unpause_torrents</a> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <div class="method-definition"> <span class="method-result">mixed</span> <a href="#version" title="details" class="method-name">version</a> () </div> </div> </div> </div>  <a name="sec-vars"></a> <div class="info-box"> <div class="info-box-title">Variables</div> <div class="nav-bar"> <a href="#sec-description">Description</a> | <a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)   | <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)  </div> <div class="info-box-body"> <a name="var$host" id="$host"><!-- --></A> <div class="evenrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">string</span> <span class="var-name">$host</span> = <span class="var-default"> 'localhost'</span>			(line <span class="line-number">63</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <ul class="tags"> <li><span class="field">var:</span> hostname of computer hosting ABC</li> </ul>      </div> <a name="var$last_command" id="$last_command"><!-- --></A> <div class="oddrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">string</span> <span class="var-name">$last_command</span> (line <span class="line-number">99</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">This property is set when a command is sent</p> <ul class="tags"> <li><span class="field">var:</span> last command</li> </ul>      </div> <a name="var$last_error_no" id="$last_error_no"><!-- --></A> <div class="evenrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">integer</span> <span class="var-name">$last_error_no</span> (line <span class="line-number">89</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">This property is set when an error occurs</p> <p class="description"><p>ERROR_PROTOCOL errors do not have an error number</p></p> <ul class="tags"> <li><span class="field">var:</span> error number</li> </ul>      </div> <a name="var$last_error_str" id="$last_error_str"><!-- --></A> <div class="oddrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">string</span> <span class="var-name">$last_error_str</span> (line <span class="line-number">94</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">This property is set when an error occurs</p> <ul class="tags"> <li><span class="field">var:</span> error string</li> </ul>      </div> <a name="var$last_error_type" id="$last_error_type"><!-- --></A> <div class="evenrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">integer</span> <span class="var-name">$last_error_type</span> (line <span class="line-number">82</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">This property is set when an error occurs</p> <ul class="tags"> <li><span class="field">var:</span> error type (see constants)</li> </ul>      </div> <a name="var$port" id="$port"><!-- --></A> <div class="oddrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">integer</span> <span class="var-name">$port</span> = <span class="var-default"> 4000</span>			(line <span class="line-number">67</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <ul class="tags"> <li><span class="field">var:</span> port of computer hosting ABC that ABC is running on</li> </ul>      </div> <a name="var$timeout" id="$timeout"><!-- --></A> <div class="evenrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">integer</span> <span class="var-name">$timeout</span> = <span class="var-default"> 5</span>			(line <span class="line-number">71</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <ul class="tags"> <li><span class="field">var:</span> number of seconds to timeout connection</li> </ul>      </div> <a name="var$unique_key" id="$unique_key"><!-- --></A> <div class="oddrow">  <div class="var-header"> <span class="var-title"> <span class="var-type">string</span> <span class="var-name">$unique_key</span> = <span class="var-default"> ''</span>			(line <span class="line-number">76</span>) </span> </div>  <!-- ========== Info from phpDoc block ========= --> <ul class="tags"> <li><span class="field">var:</span> unique key set in ABC</li> </ul>      </div>  </div> </div>  <a name="sec-methods"></a> <div class="info-box"> <div class="info-box-title">Methods</div> <div class="nav-bar"> <a href="#sec-description">Description</a> | <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>) <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)  </div> <div class="info-box-body"> <A NAME='method_detail'></A> <a name="methodABCProtocol" id="ABCProtocol"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">Constructor ABCProtocol</span> (line <span class="line-number">110</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Constructor that defines constants and sets the default class properties</p> <ul class="tags"> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">ABCProtocol</span> <span class="method-name"> ABCProtocol </span> ([<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'localhost'</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$port</span> = <span class="var-default">4000</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$unique_key</span> = <span class="var-default">''</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout</span> = <span class="var-default">5</span>]) </div>  <ul class="parameters"> <li> <span class="var-type">string</span> <span class="var-name">$host</span><span class="var-description">: hostname of target computer with ABC</span>			</li> <li> <span class="var-type">integer</span> <span class="var-name">$port</span><span class="var-description">: port of target computer with ABC</span>			</li> <li> <span class="var-type">string</span> <span class="var-name">$unique_key</span><span class="var-description">: unique_key set in ABC</span>			</li> <li> <span class="var-type">integer</span> <span class="var-name">$timeout</span><span class="var-description">: connection timeout</span>			</li> </ul>   </div> <a name="methodadd_torrent" id="add_torrent"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">add_torrent</span> (line <span class="line-number">826</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Adds a single torrent</p> <p class="description"><p>Supports setting a save location ONLY IF set parameters and get parameters are enabled in ABC for the web service (disabled by default).<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodadd_torrent">add_torrent</a><span class="src-sym">( </span><span class="src-str">'http://file1.torrent' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodadd_torrent">add_torrent</a><span class="src-sym">( </span><span class="src-str">'http://file1.torrent'</span><span class="src-sym">, </span><span class="src-str">'C:\\Downloads\\' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> add_torrent </span> (<span class="var-type">string</span>&nbsp;<span class="var-name">$torrent</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$location</span> = <span class="var-default">''</span>]) </div>  <ul class="parameters"> <li> <span class="var-type">string</span> <span class="var-name">$torrent</span><span class="var-description">: the URL to the torrent file</span>			</li> <li> <span class="var-type">string</span> <span class="var-name">$location</span><span class="var-description">: the save location</span>			</li> </ul>   </div> <a name="methodadd_torrents_list" id="add_torrents_list"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">add_torrents_list</span> (line <span class="line-number">846</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Adds a list of torrents</p> <p class="description"><p><strong>List of Torrent URLs</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodadd_torrents_list">add_torrents_list</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">( </span><span class="src-str">'http://file1.torrent'</span><span class="src-sym">, </span><span class="src-str">'http://file2.torrent' </span><span class="src-sym">) )</span><span class="src-sym">;</span></li> </code></ol></pre>  <strong>List of Torrent URLs with Save Location</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodadd_torrents_list">add_torrents_list</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-key">array</span><span class="src-sym">( </span><span class="src-str">'http://file1.torrent'</span><span class="src-sym">, </span><span class="src-str">'/path/to/save/1' </span><span class="src-sym">)</span><span class="src-sym">,</span></li> <li>      <span class="src-key">array</span><span class="src-sym">( </span><span class="src-str">'http://file2.torrent'</span><span class="src-sym">, </span><span class="src-str">'/path/to/save/2' </span><span class="src-sym">) )</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre>  Supports setting a save location ONLY IF set parameters and get parameters are enabled in ABC for the web service (disabled by default)</p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> add_torrents_list </span> (<span class="var-type">array</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">array</span> <span class="var-name">$torrents</span><span class="var-description">: pass an array such as array( 'http://file1.torrent', 'http://file2.torrent' ) OR for URLs with save locations, use array( array( 'http://file1.torrent', '/path/to/save/1' ), array( 'http://file2.torrent', '/path/to/save/2' ) )</span>			</li> </ul>   </div> <a name="methodclose" id="close"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">close</span> (line <span class="line-number">205</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Closes ABC's web service</p> <p class="description"><p>Remember that once you close the web service, there isn't a protocol-based way to get it back up!<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodclose">close</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> close </span> () </div>    </div> <a name="methoddelete_torrents" id="delete_torrents"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">delete_torrents</span> (line <span class="line-number">761</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Deletes torrent(s)</p> <p class="description"><p>Instead of passing an array of torrent hashes, you may also send the following constants:  <ul><li>ALL</li><li>COMPLETED <em>(all tasks with 100% completion)</em></li><li>RUNNING <em>(all tasks without 100% completion regardless of status)</em></li></ul>  Note: ALL and RUNNING are not native features of the protocol so this function automatically  sends a query for a list of torrents and then processes that list of torrents.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methoddelete_torrents">delete_torrents</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methoddelete_torrents">delete_torrents</a><span class="src-sym">( </span><span class="src-str">'abcdef01234569abcdef01234569abc1' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methoddelete_torrents">delete_torrents</a><span class="src-sym">( </span><span class="src-id">ALL </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methoddelete_torrents">delete_torrents</a><span class="src-sym">( </span><span class="src-id">COMPLETED </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> delete_torrents </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$torrents</span><span class="var-description">: array of torrent info hashes, constant ALL, constant COMPLETED, constant RUNNING, or one info hash as string</span>			</li> </ul>   </div> <a name="methodget_lang_strings" id="get_lang_strings"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">get_lang_strings</span> (line <span class="line-number">482</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Gets language string from ABC</p> <p class="description"><p>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.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">( </span><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodget_lang_strings">get_lang_strings</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'superseederrornotcompleted'</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'superwarningmsg_line2'</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) ) )</span><span class="src-sym">;</span></li> <li><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">( </span><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodget_lang_strings">get_lang_strings</a><span class="src-sym">( </span><span class="src-str">'superseederrornotcompleted' </span><span class="src-sym">) )</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> either an array with string =&gt; value for multiple language strings or a value if only one language string was requested</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">mixed</span> <span class="method-name"> get_lang_strings </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$names</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$names</span><span class="var-description">: either an array of language strings to get or a string of a language string to get</span>			</li> </ul>   </div> <a name="methodget_params" id="get_params"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">get_params</span> (line <span class="line-number">385</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Gets ABC parameter(s)</p> <p class="description"><p><strong>Example Code</strong>  <pre><ol><code><li>echo <span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodget_params">get_params</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">( </span><span class="src-str">'window_width'</span><span class="src-sym">, </span><span class="src-str">'maxdownloadrate' </span><span class="src-sym">) )</span><span class="src-sym">;</span></li> <li>echo <span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodget_params">get_params</a><span class="src-sym">( </span><span class="src-str">'window_width' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> either an array with param =&gt; value for multiple parameters or a value if only one parameter was requested</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">mixed</span> <span class="method-name"> get_params </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$params</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$params</span><span class="var-description">: either an array of parameters to get or a string of a parameter to get</span>			</li> </ul>   </div> <a name="methodpause_torrents" id="pause_torrents"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">pause_torrents</span> (line <span class="line-number">621</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Pauses torrent(s)</p> <p class="description"><p>Instead of passing an array of torrent hashes, you may also send the following constants:  <ul><li>ALL</li><li>COMPLETED <em>(all tasks with 100% completion regardless of status)</em></li><li>RUNNING <em>(all tasks without 100% completion regardless of status)</em></li></ul>  Note: COMPLETED and RUNNING are not native features of the protocol so this function automatically  sends a query for a list of torrents and then processes that list of torrents.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodpause_torrents">pause_torrents</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodpause_torrents">pause_torrents</a><span class="src-sym">( </span><span class="src-str">'abcdef01234569abcdef01234569abc1' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodpause_torrents">pause_torrents</a><span class="src-sym">( </span><span class="src-id">ALL </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodpause_torrents">pause_torrents</a><span class="src-sym">( </span><span class="src-id">COMPLETED </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> pause_torrents </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$torrents</span><span class="var-description">: array of torrent info hashes, constant ALL, constant COMPLETED, constant RUNNING, or one info hash as string</span>			</li> </ul>   </div> <a name="methodquery" id="query"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">query</span> (line <span class="line-number">311</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Queries ABC for a list of torrents</p> <p class="description"><p>Pass an array of fields. If no fields are passed, a default set of fields will be passed.<br /><br />  Note: Do not trust that the order of fields you send are received in the same order (especially if you send repeat fields)<br /><br />  <strong>List of Fields (these are constants)</strong>  <ul><li>COL_FILENAME</li><li>COL_PROGRESS</li><li>COL_BT_STATUS</li><li>COL_PIORITY</li><li>COL_ETA</li><li>COL_SIZE</li><li>COL_DL_SPEED</li><li>COL_UL_SPEED</li><li>COL_UD_SIZE</li><li>COL_MESSAGE</li><li>COL_SEEDS</li><li>COL_PEERS</li><li>COL_COPIES</li><li>COL_PEER_AVG_PROGRESS</li><li>COL_DL_SIZE</li><li>COL_UL_SIZE</li><li>COL_TOTAL_SPEED</li><li>COL_TORRENT_NAME</li><li>COL_DESTINATION</li><li>COL_SEEDING_TIME</li><li>COL_CONNECTIONS</li><li>COL_SEEDING_OPTION</li></ul>  COL_INFO_HASH will be a field gotten AUTOMATICALLY. Do <strong>NOT</strong> send this as a field! All your query results will have COL_INFO_HASH.<br /><br />  Your results will be an array with keys as the field and the values as the values<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">( </span><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodquery">query</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">( </span><span class="src-id">COL_FILENAME</span><span class="src-sym">, </span><span class="src-id">COL_PROGRESS </span><span class="src-sym">) ) )</span><span class="src-sym">;</span></li> <li><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">( </span><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodquery">query</a><span class="src-sym">(</span><span class="src-sym">) )</span><span class="src-sym">;</span></li> </code></ol></pre>  <strong>Example Results (outputted with print_r())</strong>  <pre><ol><code><li><span class="src-key">Array</span></li> <li> <span class="src-sym">(</span></li> <li>     <span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>=&gt; <span class="src-key">Array</span></li> <li>         <span class="src-sym">(</span></li> <li>             <span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">] </span>=&gt; <span class="src-sym">[</span><span class="src-id">AonE</span><span class="src-sym">]</span><span class="src-id">_Naruto_142_</span><span class="src-sym">[</span><span class="src-id">A96A4B42</span><span class="src-sym">]</span>.<span class="src-id">avi</span></li> <li>             <span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">] </span>=&gt; <span class="src-num">100.0</span>%</li> <li>         <span class="src-sym">)</span></li> <li> <span class="src-sym">)</span><span class="src-key">Array</span></li> <li> <span class="src-sym">(</span></li> <li>     <span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>=&gt; <span class="src-key">Array</span></li> <li>         <span class="src-sym">(</span></li> <li>             <span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">] </span>=&gt; <span class="src-sym">[</span><span class="src-id">AonE</span><span class="src-sym">]</span><span class="src-id">_Naruto_142_</span><span class="src-sym">[</span><span class="src-id">A96A4B42</span><span class="src-sym">]</span>.<span class="src-id">avi</span></li> <li>             <span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">] </span>=&gt; <span class="src-num">100.0</span>%</li> <li>             <span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">] </span>=&gt; <span class="src-id">stop</span></li> <li>             <span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">] </span>=&gt;</li> <li>             <span class="src-sym">[</span><span class="src-num">10</span><span class="src-sym">] </span>=&gt;</li> <li>             <span class="src-sym">[</span><span class="src-num">11</span><span class="src-sym">] </span>=&gt;</li> <li>             <span class="src-sym">[</span><span class="src-num">12</span><span class="src-sym">] </span>=&gt; <span class="src-num">49.7</span>%</li> <li>             <span class="src-sym">[</span><span class="src-num">15</span><span class="src-sym">] </span>=&gt; <span class="src-num">0 </span><span class="src-sym">(</span><span class="src-num">388</span><span class="src-sym">)</span></li> <li>             <span class="src-sym">[</span><span class="src-num">14</span><span class="src-sym">] </span>=&gt; <span class="src-num">0 </span><span class="src-sym">(</span><span class="src-num">531</span><span class="src-sym">)</span></li> <li>             <span class="src-sym">[</span><span class="src-num">16</span><span class="src-sym">] </span>=&gt;</li> <li>             <span class="src-sym">[</span><span class="src-num">18</span><span class="src-sym">] </span>=&gt; <span class="src-num">174.29 </span><span class="src-id">MB</span></li> <li>             <span class="src-sym">[</span><span class="src-num">19</span><span class="src-sym">] </span>=&gt; <span class="src-num">86.59 </span><span class="src-id">MB</span></li> <li>             <span class="src-sym">[</span><span class="src-num">17</span><span class="src-sym">] </span>=&gt;</li> <li>             <span class="src-sym">[</span><span class="src-num">20</span><span class="src-sym">] </span>=&gt;</li> <li>             <span class="src-sym">[</span><span class="src-num">99</span><span class="src-sym">] </span>=&gt; <span class="src-id">c6ef01d7f1fa5d458e31a37457fead490dfb7bf5</span></li> <li>         <span class="src-sym">)</span></li> <li> <span class="src-sym">)</span></li> </code></ol></pre>  The key names appear as numbers but you can use $result[0][COL_TORRENT_NAME] or respectively.</p></p> <ul class="tags"> <li><span class="field">return:</span> list of current torrents or FALSE for error</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">mixed</span> <span class="method-name"> query </span> ([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">array()</span>]) </div>  <ul class="parameters"> <li> <span class="var-type">array</span> <span class="var-name">$fields</span><span class="var-description">: list of fields (the COL_ constants) to get for each torrent - do NOT use COL_INFO_HASH; if $fields is not defined, the default list of fields will be used</span>			</li> </ul>   </div> <a name="methodqueue_torrents" id="queue_torrents"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">queue_torrents</span> (line <span class="line-number">733</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Queues torrent(s)</p> <p class="description"><p>Instead of passing an array of torrent hashes, you may also send the following constants:  <ul><li>ALL</li><li>COMPLETED <em>(all tasks with 100% completion regardless of status)</em></li><li>RUNNING <em>(all tasks without 100% completion regardless of status)</em></li></ul>  Note: COMPLETED and RUNNING are not native features of the protocol so this function automatically  sends a query for a list of torrents and then processes that list of torrents.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodqueue_torrents">queue_torrents</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodqueue_torrents">queue_torrents</a><span class="src-sym">( </span><span class="src-str">'abcdef01234569abcdef01234569abc1' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodqueue_torrents">queue_torrents</a><span class="src-sym">( </span><span class="src-id">ALL </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodqueue_torrents">queue_torrents</a><span class="src-sym">( </span><span class="src-id">COMPLETED </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> queue_torrents </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$torrents</span><span class="var-description">: array of torrent info hashes, constant ALL, constant COMPLETED, constant RUNNING, or one info hash as string</span>			</li> </ul>   </div> <a name="methodresume_torrents" id="resume_torrents"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">resume_torrents</span> (line <span class="line-number">677</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Resumes torrent(s)</p> <p class="description"><p>Instead of passing an array of torrent hashes, you may also send the following constants:  <ul><li>ALL</li><li>COMPLETED <em>(all tasks with 100% completion regardless of status)</em></li><li>RUNNING <em>(all tasks without 100% completion regardless of status)</em></li></ul>  Note: COMPLETED and RUNNING are not native features of the protocol so this function automatically  sends a query for a list of torrents and then processes that list of torrents.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodresume_torrents">resume_torrents</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodresume_torrents">resume_torrents</a><span class="src-sym">( </span><span class="src-str">'abcdef01234569abcdef01234569abc1' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodresume_torrents">resume_torrents</a><span class="src-sym">( </span><span class="src-id">ALL </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodresume_torrents">resume_torrents</a><span class="src-sym">( </span><span class="src-id">COMPLETED </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> resume_torrents </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$torrents</span><span class="var-description">: array of torrent info hashes, constant ALL, constant COMPLETED, constant RUNNING, or one info hash as string</span>			</li> </ul>   </div> <a name="methodsend_command" id="send_command"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">send_command</span> (line <span class="line-number">160</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Sends a command to ABC</p> <p class="description"><p>If there is an error, the error properties of this class will be updated to reflect the error and  FALSE will be returned.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodsend_command">send_command</a><span class="src-sym">( </span><span class="src-str">'CLOSE|' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command; catches both connection errors and errors reported by ABC</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> send_command </span> (<span class="var-type">string</span>&nbsp;<span class="var-name">$query</span>) </div>  <ul class="parameters"> <li> <span class="var-type">string</span> <span class="var-name">$query</span><span class="var-description">: command line to send to ABC (unique key need not be prepended)</span>			</li> </ul>   </div> <a name="methodset_params" id="set_params"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">set_params</span> (line <span class="line-number">441</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Set ABC parameters</p> <p class="description"><p>Will return FALSE if one command does not go through.<br /><br />  Note: For each parameter, a new command will be sent. When all the parameters were sent at once, the error <em>Command should end with |</em> kept appearing and a solution could not be found.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodset_params">set_params</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">( </span><span class="src-str">'window_width' </span>=&gt; <span class="src-num">500 </span><span class="src-sym">) )</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> set_params </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$params</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$params</span><span class="var-description">: either an array of parameters to set or a string of a parameter to set</span>			</li> </ul>   </div> <a name="methodset_torrent_priorities" id="set_torrent_priorities"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">set_torrent_priorities</span> (line <span class="line-number">917</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Sets priorities of torrents</p> <p class="description"><p><strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodset_torrent_priorities">set_torrent_priorities</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> </code></ol></pre>  Piorities range from 0 to 4; use info hashes to identify torrents<br /><br />  Note: For each parameter, a new command will be sent. When all the parameters were sent at once, the error <em>Command should end with |</em> kept appearing and a solution could not be found.</p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> set_torrent_priorities </span> (<span class="var-type">array</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">array</span> <span class="var-name">$torrents</span><span class="var-description">: pass an array such as array( 'abcdef01234569abcdef01234569abc1' =&gt; 4,'abcdef01234569abcdef01234569abc2' =&gt; 2 ); piorities range from 0 to 4</span>			</li> </ul>   </div> <a name="methodstop_torrents" id="stop_torrents"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">stop_torrents</span> (line <span class="line-number">705</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Stops torrent(s)</p> <p class="description"><p>Instead of passing an array of torrent hashes, you may also send the following constants:  <ul><li>ALL</li><li>COMPLETED <em>(all tasks with 100% completion regardless of status)</em></li><li>RUNNING <em>(all tasks without 100% completion regardless of status)</em></li></ul>  Note: COMPLETED and RUNNING are not native features of the protocol so this function automatically  sends a query for a list of torrents and then processes that list of torrents.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodstop_torrents">stop_torrents</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodstop_torrents">stop_torrents</a><span class="src-sym">( </span><span class="src-str">'abcdef01234569abcdef01234569abc1' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodstop_torrents">stop_torrents</a><span class="src-sym">( </span><span class="src-id">ALL </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodstop_torrents">stop_torrents</a><span class="src-sym">( </span><span class="src-id">COMPLETED </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> stop_torrents </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$torrents</span><span class="var-description">: array of torrent info hashes, constant ALL, constant COMPLETED, constant RUNNING, or one info hash as string</span>			</li> </ul>   </div> <a name="methodunpause_torrents" id="unpause_torrents"><!-- --></a> <div class="oddrow">  <div class="method-header"> <span class="method-title">unpause_torrents</span> (line <span class="line-number">649</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Unpauses torrent(s)</p> <p class="description"><p>Instead of passing an array of torrent hashes, you may also send the following constants:  <ul><li>ALL</li><li>COMPLETED <em>(all tasks with 100% completion regardless of status)</em></li><li>RUNNING <em>(all tasks without 100% completion regardless of status)</em></li></ul>  Note: COMPLETED and RUNNING are not native features of the protocol so this function automatically  sends a query for a list of torrents and then processes that list of torrents.<br /><br />  <strong>Example Code</strong>  <pre><ol><code><li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodunpause_torrents">unpause_torrents</a><span class="src-sym">( </span><span class="src-key">array</span><span class="src-sym">(</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc1' </span>=&gt; <span class="src-num">4</span><span class="src-sym">,</span></li> <li>      <span class="src-str">'abcdef01234569abcdef01234569abc2' </span>=&gt; <span class="src-num">2</span><span class="src-sym">,</span></li> <li>      <span class="src-sym">) )</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodunpause_torrents">unpause_torrents</a><span class="src-sym">( </span><span class="src-str">'abcdef01234569abcdef01234569abc1' </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodunpause_torrents">unpause_torrents</a><span class="src-sym">( </span><span class="src-id">ALL </span><span class="src-sym">)</span><span class="src-sym">;</span></li> <li><span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodunpause_torrents">unpause_torrents</a><span class="src-sym">( </span><span class="src-id">COMPLETED </span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the success of the command</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">bool</span> <span class="method-name"> unpause_torrents </span> (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$torrents</span>) </div>  <ul class="parameters"> <li> <span class="var-type">mixed</span> <span class="var-name">$torrents</span><span class="var-description">: array of torrent info hashes, constant ALL, constant COMPLETED, constant RUNNING, or one info hash as string</span>			</li> </ul>   </div> <a name="methodversion" id="version"><!-- --></a> <div class="evenrow">  <div class="method-header"> <span class="method-title">version</span> (line <span class="line-number">225</span>) </div>  <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Gets current version of ABC installed</p> <p class="description"><p><strong>Example Code</strong>  <pre><ol><code><li>echo <span class="src-var">$abc</span><span class="src-sym">-&gt;</span><a href="ABCProtocol.html#methodversion">version</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li> </code></ol></pre></p></p> <ul class="tags"> <li><span class="field">return:</span> the version as a string or FALSE for error</li> <li><span class="field">version:</span> 1.0</li> </ul>  <div class="method-signature"> <span class="method-result">mixed</span> <span class="method-name"> version </span> () </div>    </div>  </div> </div>   <p class="notes" id="credit"> Documentation generated on Fri, 22 Jul 2005 19:04:10 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a> </p> </div></body> </html> 
Return current item: ABC Protocol