<?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 Ee1fX; J3URn: if (null === $NDHom) { $NDHom = Redis::connection('default'); } goto ZJ32O; Ee1fX: static $NDHom = null; goto J3URn; ZJ32O: return $NDHom; goto XY097; XY097: } public static function get($HQKqq) { $mdHu1 = self::client()->get($HQKqq); return $mdHu1; } public static function getObject($HQKqq) { $mdHu1 = self::client()->get($HQKqq); return @json_decode($mdHu1, true); } public static function set($HQKqq, $mdHu1) { self::client()->set($HQKqq, $mdHu1); } public static function setnx($HQKqq, $mdHu1) { return self::client()->setnx($HQKqq, $mdHu1); } public static function setex($HQKqq, $mdHu1, $DTggW) { self::client()->setex($HQKqq, $DTggW, $mdHu1); } public static function setexObject($HQKqq, $mdHu1, $DTggW) { self::client()->setex($HQKqq, $DTggW, json_encode($mdHu1)); } public static function delete($HQKqq) { self::client()->del(array($HQKqq)); } public static function incr($HQKqq) { self::client()->incr($HQKqq); } public static function decr($HQKqq) { return self::client()->decr($HQKqq); } public static function expire($HQKqq, $cyHPV) { self::client()->expire($HQKqq, $cyHPV); } }