root/trunk/example_mktorrent.php

Revision 84, 496 bytes (checked in by m, 5 months ago)

Tagging 2.2.0 release

  • Property svn:keywords set to Id Rev
Line 
1<?php
2
3error_reporting(E_ALL);
4
5require_once 'File/Bittorrent/MakeTorrent.php';
6
7$MakeTorrent = new File_Bittorrent_MakeTorrent('example.php');
8
9// Set the announce URL
10$MakeTorrent->setAnnounce('http://www.example.org');
11// Set the comment
12$MakeTorrent->setComment('Hello World!');
13// Set the piece length (in KB)
14$MakeTorrent->setPieceLength(256);
15// Build the torrent
16$metainfo = $MakeTorrent->buildTorrent();
17// Then put this into a file, instead of echoing it normally...
18echo $metainfo;
19
20?>
Note: See TracBrowser for help on using the browser.