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

Source for file example_mktorrent.php

Documentation is available at example_mktorrent.php

  1. <?php
  2.  
  3.  
  4. require_once 'File/Bittorrent2/MakeTorrent.php';
  5.  
  6. $MakeTorrent = new File_Bittorrent2_MakeTorrent('example.php');
  7.  
  8. // Set the announce URL
  9. $MakeTorrent->setAnnounce('http://www.example.org');
  10. // Set the comment
  11. $MakeTorrent->setComment('Hello World!');
  12. // Set the piece length (in KB)
  13. $MakeTorrent->setPieceLength(256);
  14. // Build the torrent
  15. $metainfo $MakeTorrent->buildTorrent();
  16. // Then put this into a file, instead of echoing it normally...
  17. echo $metainfo;
  18.  
  19. ?>

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