2 Commits
7 changed files with 28 additions and 20 deletions

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ php:
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- nightly
matrix:
+15 -9
View File
@@ -1,16 +1,22 @@
BEncode Torrent
===============
[![Build Status](https://travis-ci.org/ApolloRIP/bencode-torrent.svg?branch=master)](https://travis-ci.org/ApolloRIP/bencode-torrent)
[![Packagist](https://img.shields.io/packagist/v/apollorip/bencode-torrent.svg)](https://packagist.org/packages/apollorip/bencode-torrent)
![PHP from Travis config](https://img.shields.io/travis/php-v/ApolloRIP/bencode-torrent.svg)
[[![Build Status](https://travis-ci.org/OPSnet/bencode-torrent.svg?branch=master)](https://travis-ci.org/OPSnet/bencode-torrent)
[![Packagist](https://img.shields.io/packagist/v/orpheusnet/bencode-torrent.svg)](https://packagist.org/packages/orpheusnet/bencode-torrent)
![PHP from Travis config](https://img.shields.io/travis/php-v/OPSnet/bencode-torrent.svg)
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
View File
@@ -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
View File
@@ -1,6 +1,6 @@
<?php
namespace ApolloRIP\BencodeTorrent;
namespace OrpheusNET\BencodeTorrent;
class Bencode {
protected $data = null;
+1 -1
View File
@@ -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 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace ApolloRip\BencodeTorrent;
namespace OrpheusNET\BencodeTorrent;
class BencodeTest extends \PHPUnit\Framework\TestCase {
public function dataProvider() {
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace ApolloRip\BencodeTorrent;
namespace OrpheusNET\BencodeTorrent;
class BencodeTorrentTest extends \PHPUnit\Framework\TestCase {
public function testLoadTorrent() {