<?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 cpx5M; jicKs: if (null === $ZkrCj) { $ZkrCj = Redis::connection('default'); } goto R7T72; cpx5M: static $ZkrCj = null; goto jicKs; R7T72: return $ZkrCj; goto EQF6M; EQF6M: } public static function get($GUcFO) { $ib3B9 = self::client()->get($GUcFO); return $ib3B9; } public static function getObject($GUcFO) { $ib3B9 = self::client()->get($GUcFO); return @json_decode($ib3B9, true); } public static function set($GUcFO, $ib3B9) { self::client()->set($GUcFO, $ib3B9); } public static function setnx($GUcFO, $ib3B9) { return self::client()->setnx($GUcFO, $ib3B9); } public static function setex($GUcFO, $ib3B9, $xQ8sn) { self::client()->setex($GUcFO, $xQ8sn, $ib3B9); } public static function setexObject($GUcFO, $ib3B9, $xQ8sn) { self::client()->setex($GUcFO, $xQ8sn, json_encode($ib3B9)); } public static function delete($GUcFO) { self::client()->del(array($GUcFO)); } public static function incr($GUcFO) { self::client()->incr($GUcFO); } public static function decr($GUcFO) { return self::client()->decr($GUcFO); } public static function expire($GUcFO, $jToSX) { self::client()->expire($GUcFO, $jToSX); } }