Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Bittorrent Component Proposal

Proposed Component Name Zend_Bittorrent
Developer Notes
Proposers Christer Edvartsen
Darby Felton, Zend liaison
Revision 0.1 - 11 October 2007: Initial proposal made
0.2 - 5 November 2007: Added use cases and some info about Zend_Bittorrent_Torrent (wiki revision: 13)

Table of Contents

1. Overview

Zend_Bittorrent is a component that can be used to encode and decode data in the bittorrent format. Zend_Bittorrent will contain convenient methods for accessing methods in the Zend_Bittorrent_Encoder and Zend_Bittorrent_Decoder classes.

The most common usage of a component such as this one would be to decode .torrent files. The information found in torrent files are the name of the file(s) included in the torrent along with file sizes and more info used by bittorrent clients when downloading torrents.

The Zend_Bittorrent_Torrent class contain ways to generate .torrent files. It can generate files based on other torrent files, or a path to a file or a directory.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will encode any encodable PHP variable (int, string, array).
  • This component will decode a bittorrent encoded string back to the original PHP counterpart.
  • This component will decode entire bittorrent files (typically .torrent)
  • This component will generate .torrent files based on a path to a file or a directory
  • This component will mimic the official btmakemetafile script when generating .torrent files.

4. Dependencies on Other Framework Components

  • Zend_Exception
  • Zend_Loader

5. Theory of Operation

When decoding it will first figure out what kind of variable the bittorrent encoded string represents and then iterate through the string decoding all nested parts (if any). When encoding it will follow the simple rules of the bittorrent specification.

6. Milestones / Tasks

  • Milestone 1: [DONE] Initial design of the classes
  • Milestone 2: [DONE] Working prototype
  • Milestone 3: [DONE] Unit tests exist and work
  • Milestone 4: Prototype and tests are checked into SVN
  • Milestone 5: Initial documentation exists.

7. Class Index

  • Zend_Bittorrent
  • Zend_Bittorrent_Encoder
  • Zend_Bittorrent_Encoder_Exception
  • Zend_Bittorrent_Decoder
  • Zend_Bittorrent_Decoder_Exception
  • Zend_Bittorrent_Torrent
  • Zend_Bittorrent_Torrent_Exception

8. Use Cases


Encode a string using the Zend_Bittorrent class:


Encode a string using the Zend_Bittorrent_Encoder class:


Decode a bittorrent file using the Zend_Bittorrent class:


Decode a bittorrent file using the Zend_Bittorrent_Decoder class:


Use the factory to generate a new .torrent file


Use the factory to generate a .torrent file from a path

9. Class Skeletons


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.