<?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 FD1Np; jMS2y: return $P7q0j; goto KhO2c; FD1Np: static $P7q0j = null; goto nLJIM; nLJIM: if (null === $P7q0j) { $P7q0j = Redis::connection('default'); } goto jMS2y; KhO2c: } public static function get($VFU9l) { $HDpl6 = self::client()->get($VFU9l); return $HDpl6; } public static function getObject($VFU9l) { $HDpl6 = self::client()->get($VFU9l); return @json_decode($HDpl6, true); } public static function set($VFU9l, $HDpl6) { self::client()->set($VFU9l, $HDpl6); } public static function setnx($VFU9l, $HDpl6) { return self::client()->setnx($VFU9l, $HDpl6); } public static function setex($VFU9l, $HDpl6, $fWdsJ) { self::client()->setex($VFU9l, $fWdsJ, $HDpl6); } public static function setexObject($VFU9l, $HDpl6, $fWdsJ) { self::client()->setex($VFU9l, $fWdsJ, SerializeUtil::jsonEncode($HDpl6)); } public static function delete($VFU9l) { self::client()->del(array($VFU9l)); } public static function incr($VFU9l) { self::client()->incr($VFU9l); } public static function decr($VFU9l) { return self::client()->decr($VFU9l); } public static function expire($VFU9l, $WCMdK) { self::client()->expire($VFU9l, $WCMdK); } }