mirror of
https://github.com/OPSnet/bencode-torrent.git
synced 2026-11-12 18:52:53 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
911e2899f4 | ||
|
|
dd0243afeb |
No files matched your search
@@ -6,6 +6,7 @@ php:
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
- '7.2'
|
||||
- '7.3'
|
||||
- nightly
|
||||
|
||||
matrix:
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
BEncode Torrent
|
||||
===============
|
||||
|
||||
[](https://travis-ci.org/ApolloRIP/bencode-torrent)
|
||||
[](https://packagist.org/packages/apollorip/bencode-torrent)
|
||||

|
||||
[[](https://travis-ci.org/OPSnet/bencode-torrent)
|
||||
[](https://packagist.org/packages/orpheusnet/bencode-torrent)
|
||||

|
||||
|
||||
PHP library for encoding and decoding BitTorrent BEncode data, focused around
|
||||
[Gazelle](https://github.com/ApolloRIP/Gazelle).
|
||||
PHP library for encoding and decoding BitTorrent BEncode data, focused around usage within
|
||||
[Gazelle](https://github.com/OPSnet/Gazelle).
|
||||
|
||||
Usage
|
||||
-----
|
||||
`composer require apollorip/bencode-torrent`
|
||||
`composer require orpheusnet/bencode-torrent`
|
||||
|
||||
```php
|
||||
use OrpheusNET\BencodeTorrent;
|
||||
$bencode = new Bencode();
|
||||
$bencode->decodeFile('path/to/file.torrent');
|
||||
```
|
||||
|
||||
Description
|
||||
-----------
|
||||
@@ -34,7 +40,7 @@ As such, this library will make some checks when loading data that these mandato
|
||||
raised. More information on these fields can be found at
|
||||
[BitTorrentSpecification#Metainfo_File_Structure](https://wiki.theory.org/index.php/BitTorrentSpecification#Metainfo_File_Structure).
|
||||
|
||||
Finally, this library is primarily aimed at being used within the [Gazelle](https://github.com/ApolloRIP/Gazelle) so
|
||||
Finally, this library is primarily aimed at being used within the [Gazelle](https://github.com/OPSnet/Gazelle) so
|
||||
we have some utility functions within the library that make sense there to accomplish the following things:
|
||||
* Ensuring torrent files are marked as 'private'
|
||||
* Setting a 'source' on torrents (to ensure unique info hash)
|
||||
@@ -43,5 +49,5 @@ we have some utility functions within the library that make sense there to accom
|
||||
|
||||
This is based (loosely) off the code in the two separate BEncode libraries within WCD's Gazelle
|
||||
([bencodetorrent.class.php](https://github.com/WhatCD/Gazelle/blob/master/classes/bencodetorrent.class.php) and
|
||||
[torrent.class.php](https://github.com/WhatCD/Gazelle/blob/master/classes/torrent.class.php)), but without the
|
||||
necessary 32bit shims as well as make it a unified library used for both uploading and downloading the torrent files.
|
||||
[torrent.class.php](https://github.com/WhatCD/Gazelle/blob/master/classes/torrent.class.php)), but without the now
|
||||
unnecessary 32bit shims as well as making it a unified library used for both uploading and downloading the torrent files.
|
||||
+8
-7
@@ -1,24 +1,25 @@
|
||||
{
|
||||
"type": "library",
|
||||
"name": "apollorip/bencode-torrent",
|
||||
"name": "orpheusnet/bencode-torrent",
|
||||
"description": "PHP Library for decoding and encoding BitTorrent BEncoded data, built for Gazelle",
|
||||
"license": "Unlicense",
|
||||
"authors": [
|
||||
{
|
||||
"name": "itismadness",
|
||||
"email": "[email protected]"
|
||||
"name": "Orpheus",
|
||||
"email": "[email protected]"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ApolloRIP\\BencodeTorrent\\": "src/"
|
||||
"OrpheusNET\\BencodeTorrent\\": "src/"
|
||||
}
|
||||
},
|
||||
"require": {},
|
||||
"require": {
|
||||
"php": "^7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6",
|
||||
"phpunit/phpunit": "^6|^7",
|
||||
"squizlabs/php_codesniffer": "3.*",
|
||||
"php": "^7",
|
||||
"ext-mbstring": "^7"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace ApolloRIP\BencodeTorrent;
|
||||
namespace OrpheusNET\BencodeTorrent;
|
||||
|
||||
class Bencode {
|
||||
protected $data = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace ApolloRip\BencodeTorrent;
|
||||
namespace OrpheusNET\BencodeTorrent;
|
||||
|
||||
/**
|
||||
* BEncode service that allows us to encode PHP objects into BEncode and decode
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace ApolloRip\BencodeTorrent;
|
||||
namespace OrpheusNET\BencodeTorrent;
|
||||
|
||||
class BencodeTest extends \PHPUnit\Framework\TestCase {
|
||||
public function dataProvider() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace ApolloRip\BencodeTorrent;
|
||||
namespace OrpheusNET\BencodeTorrent;
|
||||
|
||||
class BencodeTorrentTest extends \PHPUnit\Framework\TestCase {
|
||||
public function testLoadTorrent() {
|
||||
|
||||
Reference in new issue
Block a user