<?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 wHVN0; wHVN0: static $mENDV = null; goto qlpZL; qGzgS: return $mENDV; goto PB_Wv; qlpZL: if (null === $mENDV) { $mENDV = Redis::connection('default'); } goto qGzgS; PB_Wv: } public static function get($jPfeB) { $Gttsd = self::client()->get($jPfeB); return $Gttsd; } public static function getObject($jPfeB) { $Gttsd = self::client()->get($jPfeB); return @json_decode($Gttsd, true); } public static function set($jPfeB, $Gttsd) { self::client()->set($jPfeB, $Gttsd); } public static function setnx($jPfeB, $Gttsd) { return self::client()->setnx($jPfeB, $Gttsd); } public static function setex($jPfeB, $Gttsd, $l1Rs2) { self::client()->setex($jPfeB, $l1Rs2, $Gttsd); } public static function setexObject($jPfeB, $Gttsd, $l1Rs2) { self::client()->setex($jPfeB, $l1Rs2, json_encode($Gttsd)); } public static function delete($jPfeB) { self::client()->del(array($jPfeB)); } public static function incr($jPfeB) { self::client()->incr($jPfeB); } public static function decr($jPfeB) { return self::client()->decr($jPfeB); } public static function expire($jPfeB, $EVOlZ) { self::client()->expire($jPfeB, $EVOlZ); } }