Torrent::announce_list PHP Method

announce_list() protected static method

Build announce list
protected static announce_list ( $announce, $merge = [] ) : array
return array announce list (array of arrays)
    protected static function announce_list($announce, $merge = array())
    {
        return array_map(create_function('$a', 'return (array) $a;'), array_merge((array) $announce, (array) $merge));
    }

Usage Example

                 $trackers = array();
             }
         }
     }
 }
 if (count($trackers) > 0) {
     $announce_list[] = $trackers;
 }
 $path_edit = trim($request['path_edit']);
 $piece_size = $request['piece_size'];
 $callback_log = create_function('$msg', '$fp=fopen("php://stdout","w"); fputs($fp, $msg."\\n"); fclose($fp);');
 $callback_err = create_function('$msg', '$fp=fopen("php://stderr","w"); fputs($fp, $msg."\\n"); fclose($fp);');
 if (count($announce_list) > 0) {
     $torrent = new Torrent($path_edit, $announce_list[0][0], $piece_size, $callback_log, $callback_err);
     if ($trackersCount > 1) {
         $torrent->announce_list($announce_list);
     }
 } else {
     $torrent = new Torrent($path_edit, array(), $piece_size, $callback_log, $callback_err);
 }
 if (isset($request['comment'])) {
     $comment = trim($request['comment']);
     if (strlen($comment)) {
         $torrent->comment($comment);
     }
 }
 if ($request['private']) {
     $torrent->is_private(true);
 }
 $fname = rTask::formatPath($taskNo) . '/result.torrent';
 $torrent->save($fname);
All Usage Examples Of Torrent::announce_list