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

Class: File_Bittorrent_Decode

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

Class Overview


Encode data in Bittorrent format


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 78]
Encode data in Bittorrent format

Based on Original Python implementation by Petru Paler <petru@paler.net> PHP translation by Gerard Krijgsman <webmaster@animesuki.com> Gerard's regular expressions removed by Carl Ritson <critson@perlfu.co.uk> Info on the .torrent file format BEncoding is a simple, easy to implement method of associating data types with information in a file. The values in a torrent file are bEncoded. There are 4 different data types that can be bEncoded: Integers, Strings, Lists and Dictionaries. [http://www.monduna.com/bt/faq.html]



[ Top ]


Class Variables

$announce =  ''

[line 118]

  • Var: tracker (the tracker the torrent has been received from)

Type:   string


[ Top ]

$announce_list = array()

[line 123]

  • Var: List of known trackers for the torrent

Type:   array


[ Top ]

$comment =  ''

[line 93]

  • Var: Comment

Type:   string


[ Top ]

$created_by =  ''

[line 113]

  • Var: Signature of the software which created the torrent

Type:   string


[ Top ]

$date =  0

[line 98]

  • Var: Creation date as unix timestamp

Type:   int


[ Top ]

$decoded = array()

[line 156]

  • Var: Decoded data from File_Bittorrent_Decode::decodeFile()

Type:   array


[ Top ]

$filename =  ''

[line 88]

  • Var: Filename of the torrent

Type:   string


[ Top ]

$files = array()

[line 103]

  • Var: Files in the torrent

Type:   array


[ Top ]

$info_hash =

[line 146]

  • Var: Info hash

Type:   string


[ Top ]

$last_error =

[line 151]

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

Type:   mixed


[ Top ]

$name =  ''

[line 83]

  • Var: Name of the torrent

Type:   string


[ Top ]

$size =  0

[line 108]

  • Var: Size of of the full torrent (after download)

Type:   int


[ Top ]



Method Detail

decode   [line 164]

mixed decode( string $str)

Decode a Bencoded string

Parameters:

string   $str   — 

[ Top ]

decodeFile   [line 183]

mixed decodeFile( string $file)

Decode .torrent file and accumulate information
  • Return: Returns an arrayon success or false on error

Parameters:

string   $file   —  Filename

[ Top ]

getStats   [line 499]

array|false getStats( )

Returns the online stats for the torrent

[ Top ]


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