File_Bittorrent
[ class tree: File_Bittorrent ] [ index: File_Bittorrent ] [ all elements ]

Class: File_Bittorrent_MakeTorrent

Source Location: /File_Bittorrent-1.1.0/File/Bittorrent/MakeTorrent.php

Class Overview


Provides a class for making .torrent files from a file or directory. Produces virtually identical torrent files as btmaketorrent.py from Bram Cohen's original BT client.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
Provides a class for making .torrent files from a file or directory. Produces virtually identical torrent files as btmaketorrent.py from Bram Cohen's original BT client.


[ Top ]


Class Variables

$last_error =

[line 138]

  • Var: The last error object or null if no error has occurred.

Type:   mixed


[ Top ]



Method Detail

File_Bittorrent_MakeTorrent (Constructor)   [line 148]

File_Bittorrent_MakeTorrent File_Bittorrent_MakeTorrent( string $path)

Constructor

Sets up the path to the file/dir to create a torrent from


Parameters:

string   $path   —  Path to use

[ Top ]

buildTorrent   [line 244]

mixed buildTorrent( )

Function to build the .torrent file based on the parameters you have set with the set* functions.
  • Return: false on failure or a string containing the metainfo

[ Top ]

setAnnounce   [line 160]

bool setAnnounce( string $announce)

Function to set the announce URL for the .torrent file

Parameters:

string   $announce   —  announce url

[ Top ]

setAnnounceList   [line 173]

bool setAnnounceList( array $announce_list)

Function to set the announce list for the .torrent file

Parameters:

array   $announce_list   —  announce list

[ Top ]

setComment   [line 190]

bool setComment( string $comment)

Function to set the comment for the .torrent file

Parameters:

string   $comment   —  comment

[ Top ]

setPath   [line 204]

bool setPath( string $path)

Function to set the path for the file/dir to make the .torrent for Can also be set through the constructor.

Parameters:

string   $path   —  path to file/dir

[ Top ]

setPieceLength   [line 227]

bool setPieceLength( int $piece_length)

Function to set the piece length for the .torrent file.

min: 32 (32KB), max: 4096 (4MB)


Parameters:

int   $piece_length   —  piece length in kilobytes

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:57:21 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.