torrent file
5.3.1
一个处理torrent file PHP 类
composer require arokettu/torrent-file
<?php
use Arokettu Torrent TorrentFile ;
// open file
$ torrent = TorrentFile:: load ( ' debian.torrent ' );
// create for path (file or directory)
$ torrent = TorrentFile:: fromPath ( ' /home/user/dists/debian ' );
// manipulate fields
$ torrent -> setAnnounce ( ' http://tracker.example:1234 ' );
// list files
foreach ( $ torrent -> v1 ()-> getFiles () as $ file ) {
echo implode ( ' / ' , $ file -> path ()) , ' : ' , $ file -> length , PHP_EOL ;
}
基于该库的 CLI 工具:https://sandfox.dev/php/torrent-file-cli.html
在此处阅读完整文档:https://sandfox.dev/php/torrent-file.html
另请阅读文档:https://torrent-file.readthedocs.io/
请在 GitLab 的主存储库上提交问题:https://gitlab.com/sandfox/torrent-file/-/issues
如果有任何问题,请随时在我们的 Gitter 房间里提问:https://gitter.im/arokettu/community
支持的版本:
该库根据 MIT 许可证条款作为开源提供。