Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
style(Bencode): Separate Bencode library to Rhilip/Bencode
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Jan 23, 2020
1 parent 81f0783 commit 18cbfa1
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 174 deletions.
3 changes: 2 additions & 1 deletion application/Controllers/TrackerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

use App\Libraries\Constant;
use App\Repository\User\UserRole;
use App\Libraries\Bencode\Bencode;
use App\Exceptions\TrackerException;

use Rid\Utils\IpUtils;

use Rhilip\Bencode\Bencode;

/** @noinspection PhpUnused */
class TrackerController
{
Expand Down
149 changes: 0 additions & 149 deletions application/Libraries/Bencode/Bencode.php

This file was deleted.

13 changes: 0 additions & 13 deletions application/Libraries/Bencode/ParseErrorException.php

This file was deleted.

8 changes: 4 additions & 4 deletions application/Middleware/AuthMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ public function handle($callable, \Closure $next)
*/
$route = strtolower(
str_replace(
['App\\Controllers\\', 'Controller', 'action'],
'',
$controllerName . '_' . $action
)
['App\\Controllers\\', 'Controller', 'action'],
'',
$controllerName . '_' . $action
)
);

$required_class = config('route.' . $route) ?: 1;
Expand Down
3 changes: 2 additions & 1 deletion application/Models/Form/Torrent/DownloadForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
namespace App\Models\Form\Torrent;

use App\Models\Form\Traits\FileSentTrait;
use App\Libraries\Bencode\Bencode;

use Rhilip\Bencode\Bencode;

class DownloadForm extends StructureForm
{
Expand Down
3 changes: 2 additions & 1 deletion application/Models/Form/Torrent/StructureForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
namespace App\Models\Form\Torrent;

use App\Libraries\Constant;
use App\Libraries\Bencode\Bencode;

use Rhilip\Bencode\Bencode;

class StructureForm extends DetailsForm
{
Expand Down
5 changes: 3 additions & 2 deletions application/Models/Form/Torrent/UploadForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
use App\Libraries\Constant;
use App\Repository\Torrent\TorrentStatus;
use App\Repository\Torrent\TorrentType;
use App\Libraries\Bencode\Bencode;
use App\Libraries\Bencode\ParseErrorException;

use Rid\Http\UploadFile;

use Rhilip\Bencode\Bencode;
use Rhilip\Bencode\ParseErrorException;

class UploadForm extends EditForm
{

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"siriusphp/validation": "^2.3",
"mjohnson/decoda": "^6.12",
"symfony/translation": "^4.3",
"symfony/config": "^4.3"
"symfony/config": "^4.3",
"rhilip/bencode": "^1.0"
},
"require-dev": {
"eaglewu/swoole-ide-helper": "dev-master"
Expand Down
46 changes: 45 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/torrent/structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @var \App\Models\Form\Torrent\StructureForm $structure
*/

use App\Libraries\Bencode\Bencode;
use Rhilip\Bencode\Bencode;

if (!function_exists('torrent_structure_builder')) {
function torrent_structure_builder($array, $parent = "")
Expand Down

0 comments on commit 18cbfa1

Please sign in to comment.