<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Facades\Redis; class RedisUtil { public static function isEnable() { return !!config('env.REDIS_HOST'); } public static function client() { goto oaZAV; oaZAV: static $jKrjo = null; goto kTxm2; F6JOV: return $jKrjo; goto BGu4d; kTxm2: if (null === $jKrjo) { $jKrjo = Redis::connection('default'); } goto F6JOV; BGu4d: } public static function get($ax5t3) { $FT9zA = self::client()->get($ax5t3); return $FT9zA; } public static function getObject($ax5t3) { $FT9zA = self::client()->get($ax5t3); return @json_decode($FT9zA, true); } public static function set($ax5t3, $FT9zA) { self::client()->set($ax5t3, $FT9zA); } public static function setnx($ax5t3, $FT9zA) { return self::client()->setnx($ax5t3, $FT9zA); } public static function setex($ax5t3, $FT9zA, $AfwyP) { self::client()->setex($ax5t3, $AfwyP, $FT9zA); } public static function setexObject($ax5t3, $FT9zA, $AfwyP) { self::client()->setex($ax5t3, $AfwyP, json_encode($FT9zA)); } public static function delete($ax5t3) { self::client()->del(array($ax5t3)); } public static function incr($ax5t3) { self::client()->incr($ax5t3); } public static function decr($ax5t3) { return self::client()->decr($ax5t3); } public static function expire($ax5t3, $lMemx) { self::client()->expire($ax5t3, $lMemx); } }