This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(torrents): Use Torrent Form Model in TorrentController
- Loading branch information
Showing
13 changed files
with
122 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Rhilip | ||
* Date: 8/7/2019 | ||
* Time: 7:22 PM | ||
*/ | ||
|
||
namespace apps\models\form\Torrent; | ||
|
||
use apps\models\form\Traits\isValidTorrentTrait; | ||
|
||
use Rid\Validators\Validator; | ||
|
||
class DetailsForm extends Validator | ||
{ | ||
|
||
use isValidTorrentTrait; | ||
|
||
public static function inputRules() | ||
{ | ||
return [ | ||
'id' => 'required | Integer' | ||
]; | ||
} | ||
|
||
public static function callbackRules() | ||
{ | ||
return ['isExistTorrent']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Rhilip | ||
* Date: 8/7/2019 | ||
* Time: 6:58 PM | ||
*/ | ||
|
||
namespace apps\models\form\Torrent; | ||
|
||
use Rid\Bencode\Bencode; | ||
|
||
class StructureForm extends DetailsForm | ||
{ | ||
|
||
public function getTorrentFileContentDict() | ||
{ | ||
$file_loc = app()->site->getTorrentFileLoc($this->id); | ||
$content = Bencode::load($file_loc); | ||
return $content; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.