mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 15:12:21 +08:00
fix check redis version
This commit is contained in:
@@ -3,8 +3,9 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Events\TorrentUpdated;
|
use App\Events\TorrentUpdated;
|
||||||
|
use App\Filament\Resources\System\AgentAllowResource;
|
||||||
use App\Http\Resources\TagResource;
|
use App\Http\Resources\TagResource;
|
||||||
use App\Models\Ability;
|
use App\Models\AgentAllow;
|
||||||
use App\Models\Attendance;
|
use App\Models\Attendance;
|
||||||
use App\Models\Exam;
|
use App\Models\Exam;
|
||||||
use App\Models\ExamProgress;
|
use App\Models\ExamProgress;
|
||||||
@@ -12,7 +13,6 @@ use App\Models\ExamUser;
|
|||||||
use App\Models\HitAndRun;
|
use App\Models\HitAndRun;
|
||||||
use App\Models\Medal;
|
use App\Models\Medal;
|
||||||
use App\Models\Peer;
|
use App\Models\Peer;
|
||||||
use App\Models\Role;
|
|
||||||
use App\Models\SearchBox;
|
use App\Models\SearchBox;
|
||||||
use App\Models\Snatch;
|
use App\Models\Snatch;
|
||||||
use App\Models\Tag;
|
use App\Models\Tag;
|
||||||
@@ -37,6 +37,7 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Redis;
|
use Illuminate\Support\Facades\Redis;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use JeroenG\Explorer\Domain\Syntax\Matching;
|
use JeroenG\Explorer\Domain\Syntax\Matching;
|
||||||
use JeroenG\Explorer\Infrastructure\Scout\ElasticEngine;
|
use JeroenG\Explorer\Infrastructure\Scout\ElasticEngine;
|
||||||
use League\Flysystem\StorageAttributes;
|
use League\Flysystem\StorageAttributes;
|
||||||
@@ -46,7 +47,6 @@ use NexusPlugin\PostLike\PostLikeRepository;
|
|||||||
use NexusPlugin\StickyPromotion\Models\StickyPromotion;
|
use NexusPlugin\StickyPromotion\Models\StickyPromotion;
|
||||||
use NexusPlugin\StickyPromotion\Models\StickyPromotionParticipator;
|
use NexusPlugin\StickyPromotion\Models\StickyPromotionParticipator;
|
||||||
use Rhilip\Bencode\Bencode;
|
use Rhilip\Bencode\Bencode;
|
||||||
use Silber\Bouncer\Bouncer;
|
|
||||||
|
|
||||||
class Test extends Command
|
class Test extends Command
|
||||||
{
|
{
|
||||||
@@ -81,7 +81,12 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
Ability::initDefaults();
|
$r = Str::of(class_basename(\App\Models\AgentAllow::class))
|
||||||
|
->plural()
|
||||||
|
->kebab()
|
||||||
|
->slug();
|
||||||
|
|
||||||
|
dd($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -371,13 +371,16 @@ class NexusDB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed|\Redis|null
|
||||||
|
*/
|
||||||
public static function redis()
|
public static function redis()
|
||||||
{
|
{
|
||||||
if (IN_NEXUS) {
|
if (IN_NEXUS) {
|
||||||
global $Cache;
|
global $Cache;
|
||||||
$Cache->getRedis();
|
return $Cache->getRedis();
|
||||||
} else {
|
} else {
|
||||||
Redis::connection()->client();
|
return Redis::connection()->client();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -665,8 +665,7 @@ class Install
|
|||||||
|
|
||||||
public function getRedisVersionInfo(): array
|
public function getRedisVersionInfo(): array
|
||||||
{
|
{
|
||||||
global $Cache;
|
$redis = NexusDB::redis();
|
||||||
$redis = $Cache->getRedis();
|
|
||||||
$result = $redis->info();
|
$result = $redis->info();
|
||||||
$version = $result['redis_version'];
|
$version = $result['redis_version'];
|
||||||
$match = version_compare($version, '2.0.0', '>=');
|
$match = version_compare($version, '2.0.0', '>=');
|
||||||
|
|||||||
Reference in New Issue
Block a user