规范代码

This commit is contained in:
iyuu.cn
2020-02-01 21:47:20 +08:00
parent 76c0cefca2
commit ea158ddd55
2 changed files with 36 additions and 29 deletions

View File

@ -414,7 +414,8 @@ class AutoReseed
/** /**
* IYUUAutoReseed辅种 * IYUUAutoReseed辅种
*/ */
public static function reseed($hashArray = array()){ public static function reseed($hashArray = array())
{
global $configALL; global $configALL;
$sites = array(); $sites = array();
// 前置过滤 // 前置过滤
@ -630,7 +631,8 @@ class AutoReseed
/** /**
* IYUUAutoReseed做种客户端转移 * IYUUAutoReseed做种客户端转移
*/ */
public static function move($hashArray = array()){ public static function move($hashArray = array())
{
global $configALL; global $configALL;
$sites = array(); $sites = array();
// 前置过滤2020年1月26日15:52:41 // 前置过滤2020年1月26日15:52:41
@ -823,11 +825,14 @@ class AutoReseed
/** /**
* 过滤已转移的种子hash * 过滤已转移的种子hash
*/ */
public static function hashFilter(&$hash = array()){ public static function hashFilter(&$hash = array())
{
foreach ($hash as $client => $json) { foreach ($hash as $client => $json) {
$data = array(); $data = array();
$data = json_decode($json, true); $data = json_decode($json, true);
if (empty($data)) continue; if (empty($data)) {
continue;
}
foreach ($data as $key => $info_hash) { foreach ($data as $key => $info_hash) {
if (is_file(self::$cacheMove . $info_hash.'.txt')) { if (is_file(self::$cacheMove . $info_hash.'.txt')) {
echo '-------当前种子上次已成功转移,前置过滤已跳过! ' .PHP_EOL.PHP_EOL; echo '-------当前种子上次已成功转移,前置过滤已跳过! ' .PHP_EOL.PHP_EOL;
@ -882,7 +887,8 @@ class AutoReseed
/** /**
* 获取站点种子的URL * 获取站点种子的URL
*/ */
public static function getTorrentUrl($site = '',$_url = ''){ public static function getTorrentUrl($site = '', $_url = '')
{
global $configALL; global $configALL;
switch ($site) { switch ($site) {
case 'ttg': case 'ttg':

View File

@ -1,6 +1,7 @@
<?php <?php
require_once __DIR__ . '/init.php'; require_once __DIR__ . '/init.php';
use IYUU\AutoReseed; use IYUU\AutoReseed;
echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL; echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL;
AutoReseed::init(); AutoReseed::init();
$hashArray = AutoReseed::get(); $hashArray = AutoReseed::get();