mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
Merge branch '1.7' into php8
This commit is contained in:
@@ -41,7 +41,7 @@ class AttendanceMigrate extends Command
|
||||
{
|
||||
$rep = new AttendanceRepository();
|
||||
$result = $rep->migrateAttendance();
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', REQUEST_ID, __METHOD__, var_export($result, true), last_query());
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', nexus() ? nexus()->getRequestId() : 'NO_REQUEST_ID', __METHOD__, var_export($result, true), last_query());
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
|
||||
@@ -42,7 +42,7 @@ class BackuAll extends Command
|
||||
$result = $rep->backupAll();
|
||||
$log = sprintf(
|
||||
'[%s], %s, result: %s',
|
||||
REQUEST_ID, __METHOD__, var_export($result, true)
|
||||
nexus()->getRequestId(), __METHOD__, var_export($result, true)
|
||||
);
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
|
||||
@@ -42,7 +42,7 @@ class BackupCronjob extends Command
|
||||
$result = $rep->cronjobBackup();
|
||||
$log = sprintf(
|
||||
'[%s], %s, result: %s',
|
||||
REQUEST_ID, __METHOD__, var_export($result, true)
|
||||
nexus()->getRequestId(), __METHOD__, var_export($result, true)
|
||||
);
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
|
||||
@@ -40,7 +40,7 @@ class BackupDatabase extends Command
|
||||
{
|
||||
$rep = new ToolRepository();
|
||||
$result = $rep->backupDatabase();
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class BackupWeb extends Command
|
||||
{
|
||||
$rep = new ToolRepository();
|
||||
$result = $rep->backupWeb();
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class DeleteExpiredToken extends Command
|
||||
|
||||
$query->where('last_used_at', '<', Carbon::now()->subDays($days));
|
||||
$result = $query->delete();
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', REQUEST_ID, __METHOD__, var_export($result, true), last_query());
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true), last_query());
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
|
||||
@@ -45,7 +45,7 @@ class ExamAssign extends Command
|
||||
$end = $this->option('end');
|
||||
$this->info(sprintf('uid: %s, examId: %s, begin: %s, end: %s', $uid, $examId, $begin, $end));
|
||||
$result = $examRep->assignToUser($uid, $examId, $begin, $end);
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
|
||||
@@ -40,7 +40,7 @@ class ExamAssignCronjob extends Command
|
||||
{
|
||||
$examRep = new ExamRepository();
|
||||
$result = $examRep->cronjonAssign();
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
|
||||
@@ -42,7 +42,7 @@ class ExamCheckoutCronjob extends Command
|
||||
$ignoreTimeRange = $this->option('ignore-time-range');
|
||||
$this->info('ignore-time-range: ' . var_export($ignoreTimeRange, true));
|
||||
$result = $examRep->cronjobCheckout($ignoreTimeRange);
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
|
||||
@@ -42,7 +42,7 @@ class ExamUpdateProgress extends Command
|
||||
$uid = $this->argument('uid');
|
||||
$examRep = new ExamRepository();
|
||||
$result = $examRep->updateProgress($uid);
|
||||
$this->info(REQUEST_ID . ", result: " . var_export($result, true));
|
||||
$this->info(nexus()->getRequestId() . ", result: " . var_export($result, true));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ class HitAndRunUpdateStatus extends Command
|
||||
$rep = new HitAndRunRepository();
|
||||
$result = $rep->cronjobUpdateStatus($uid, $torrentId, $ignoreTime);
|
||||
$log = sprintf(
|
||||
'[%s], %s, uid: %s, torrentId: %s, ignoreTime: %s, result: %s',
|
||||
REQUEST_ID, __METHOD__, $uid, $torrentId, $ignoreTime, var_export($result, true)
|
||||
'[%s], %s, uid: %s, torrentId: %s, result: %s',
|
||||
nexus()->getRequestId(), __METHOD__, $uid, $torrentId, var_export($result, true)
|
||||
);
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
|
||||
@@ -43,7 +43,7 @@ class MigrateTorrentTag extends Command
|
||||
{
|
||||
$rep = new TagRepository();
|
||||
$result = $rep->migrateTorrentTag();
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', REQUEST_ID, __METHOD__, var_export($result, true), last_query());
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true), last_query());
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Events\TorrentUpdated;
|
||||
use App\Http\Resources\TagResource;
|
||||
use App\Models\Attendance;
|
||||
use App\Models\Exam;
|
||||
@@ -9,15 +10,18 @@ use App\Models\ExamProgress;
|
||||
use App\Models\ExamUser;
|
||||
use App\Models\HitAndRun;
|
||||
use App\Models\Medal;
|
||||
use App\Models\Peer;
|
||||
use App\Models\SearchBox;
|
||||
use App\Models\Snatch;
|
||||
use App\Models\Tag;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\User;
|
||||
use App\Repositories\AgentAllowRepository;
|
||||
use App\Repositories\AttendanceRepository;
|
||||
use App\Repositories\ExamRepository;
|
||||
use App\Repositories\HitAndRunRepository;
|
||||
use App\Repositories\SearchBoxRepository;
|
||||
use App\Repositories\SearchRepository;
|
||||
use App\Repositories\TagRepository;
|
||||
use App\Repositories\TorrentRepository;
|
||||
use App\Repositories\UserRepository;
|
||||
@@ -27,7 +31,10 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Encryption\Encrypter;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use JeroenG\Explorer\Domain\Syntax\Matching;
|
||||
use JeroenG\Explorer\Infrastructure\Scout\ElasticEngine;
|
||||
use Rhilip\Bencode\Bencode;
|
||||
|
||||
class Test extends Command
|
||||
@@ -63,9 +70,55 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$rep = new AttendanceRepository();
|
||||
$r = $rep->migrateAttendance();
|
||||
$searchRep = new SearchRepository();
|
||||
$r = $searchRep->deleteIndex();
|
||||
$r = $searchRep->createIndex();
|
||||
$r = $searchRep->import();
|
||||
|
||||
$arr = [
|
||||
'cat' => 'category',
|
||||
'source' => 'source',
|
||||
'medium' => 'medium',
|
||||
'codec' => 'codec',
|
||||
'audiocodec' => 'audiocodec',
|
||||
'standard' => 'standard',
|
||||
'processing' => 'processing',
|
||||
'team' => 'team',
|
||||
];
|
||||
$queryString = 'cat401=1&cat404=1&source2=1&medium2=1&medium3=1&codec3=1&audiocodec3=1&standard2=1&standard3=1&processing2=1&team3=1&team4=1&incldead=1&spstate=0&inclbookmarked=0&search=&search_area=0&search_mode=0';
|
||||
$userSetting = '[cat401][cat404][sou1][med1][cod1][sta2][sta3][pro2][tea2][aud2][incldead=0][spstate=3][inclbookmarked=2]';
|
||||
// foreach ($arr as $queryField => $value) {
|
||||
//// $pattern = sprintf("/\[%s([\d]+)\]/", substr($queryField, 0, 3));
|
||||
// $pattern = "/{$queryField}([\d]+)=/";
|
||||
// if (preg_match_all($pattern, $queryString, $matches)) {
|
||||
// dump($matches);
|
||||
// echo '----------------------' . PHP_EOL;
|
||||
// }
|
||||
// }
|
||||
// $r = preg_match("/\[incldead=([\d]+)\]/", $userSetting, $matches);
|
||||
// dump($matches);
|
||||
|
||||
$params = [
|
||||
'tag_id' => 1,
|
||||
// 'incldead' => 0,
|
||||
// 'spstate' => 0,
|
||||
// 'inclbookmarked' => 0,
|
||||
// 'search' => '5034',
|
||||
// 'search_area' => 4,
|
||||
// 'search_mode' => 0,
|
||||
];
|
||||
$queryString = "cat401=1&cat404=1&cat405=1&cat402=1&cat403=1&cat406=1&cat407=1&cat409=1&cat408=1&incldead=0&spstate=0&inclbookmarked=0&search=5034838&search_area=4&search_mode=0";
|
||||
// $r = $searchRep->listTorrentFromEs($params, 1, '');
|
||||
|
||||
// $r = $searchRep->updateTorrent(1);
|
||||
// $r = $searchRep->updateUser(1);
|
||||
// $r = $searchRep->addTorrent(1);
|
||||
// $r = $searchRep->deleteBookmark(1);
|
||||
// $r = $searchRep->addBookmark(1);
|
||||
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class UserResetPassword extends Command
|
||||
|
||||
$rep = new UserRepository();
|
||||
$result = $rep->resetPassword($uid, $password, $passwordConfirmation);
|
||||
$log = sprintf('[%s], %s, result: %s', REQUEST_ID, __METHOD__, var_export($result, true));
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user