From 9445ef98ac50ec64c933eeed823ffc64f03d68b1 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Fri, 8 Apr 2022 16:28:00 +0800 Subject: [PATCH] peer to json exclude peer_id --- app/Repositories/TrackerRepository.php | 3 ++- nexus/Install/Install.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Repositories/TrackerRepository.php b/app/Repositories/TrackerRepository.php index 1f1d3a04..c9ae61c9 100644 --- a/app/Repositories/TrackerRepository.php +++ b/app/Repositories/TrackerRepository.php @@ -446,7 +446,8 @@ class TrackerRepository extends BaseRepository } $duration = Carbon::now()->diffInSeconds($peer->last_action); $upSpeed = $dataTraffic['uploaded_increment'] > 0 ? ($dataTraffic['uploaded_increment'] / $duration) : 0; - do_log("peer: " . $peer->toJson() . ", upSpeed: $upSpeed, dataTraffic: " . json_encode($dataTraffic)); + $peerInfo = Arr::except($peer->toArray(), ['peer_id']); + do_log("peerInfo: " . json_encode($peerInfo) . ", upSpeed: $upSpeed, dataTraffic: " . json_encode($dataTraffic)); $oneGB = 1024 * 1024 * 1024; $tenMB = 1024 * 1024 * 10; $nowStr = Carbon::now()->toDateTimeString(); diff --git a/nexus/Install/Install.php b/nexus/Install/Install.php index 7c9394e1..ee1b327f 100644 --- a/nexus/Install/Install.php +++ b/nexus/Install/Install.php @@ -128,7 +128,7 @@ class Install public function listRequirementTableRows() { $gdInfo = function_exists('gd_info') ? gd_info() : []; - $extensions = ['ctype', 'fileinfo', 'json', 'mbstring', 'openssl', 'pdo_mysql', 'tokenizer', 'xml', 'mysqli', 'bcmath', 'redis', 'gd', 'pcntl', 'sockets']; + $extensions = ['ctype', 'fileinfo', 'json', 'mbstring', 'openssl', 'pdo_mysql', 'tokenizer', 'xml', 'mysqli', 'bcmath', 'redis', 'gd', 'pcntl', 'sockets', 'posix']; $tableRows = []; $tableRows[] = [ 'label' => 'PHP version',