<?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 j7x2c; w_7C1: return $BlDdq; goto cUXAF; QJp2m: if (null === $BlDdq) { $BlDdq = Redis::connection('default'); } goto w_7C1; j7x2c: static $BlDdq = null; goto QJp2m; cUXAF: } public static function get($l6tBV) { $Mczr_ = self::client()->get($l6tBV); return $Mczr_; } public static function getObject($l6tBV) { $Mczr_ = self::client()->get($l6tBV); return @json_decode($Mczr_, true); } public static function set($l6tBV, $Mczr_) { self::client()->set($l6tBV, $Mczr_); } public static function setnx($l6tBV, $Mczr_) { return self::client()->setnx($l6tBV, $Mczr_); } public static function setex($l6tBV, $Mczr_, $jws3Z) { self::client()->setex($l6tBV, $jws3Z, $Mczr_); } public static function setexObject($l6tBV, $Mczr_, $jws3Z) { self::client()->setex($l6tBV, $jws3Z, SerializeUtil::jsonEncode($Mczr_)); } public static function delete($l6tBV) { self::client()->del(array($l6tBV)); } public static function incr($l6tBV) { self::client()->incr($l6tBV); } public static function decr($l6tBV) { return self::client()->decr($l6tBV); } public static function expire($l6tBV, $nSa3y) { self::client()->expire($l6tBV, $nSa3y); } }