<?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 yZmCj; At8Yd: if (null === $I9W4B) { $I9W4B = Redis::connection('default'); } goto TBkO4; TBkO4: return $I9W4B; goto TbVRN; yZmCj: static $I9W4B = null; goto At8Yd; TbVRN: } public static function get($dwwIV) { $wvO30 = self::client()->get($dwwIV); return $wvO30; } public static function getObject($dwwIV) { $wvO30 = self::client()->get($dwwIV); return @json_decode($wvO30, true); } public static function set($dwwIV, $wvO30) { self::client()->set($dwwIV, $wvO30); } public static function setnx($dwwIV, $wvO30) { return self::client()->setnx($dwwIV, $wvO30); } public static function setex($dwwIV, $wvO30, $THkB2) { self::client()->setex($dwwIV, $THkB2, $wvO30); } public static function setexObject($dwwIV, $wvO30, $THkB2) { self::client()->setex($dwwIV, $THkB2, json_encode($wvO30)); } public static function delete($dwwIV) { self::client()->del(array($dwwIV)); } public static function incr($dwwIV) { self::client()->incr($dwwIV); } public static function decr($dwwIV) { return self::client()->decr($dwwIV); } public static function expire($dwwIV, $frgnc) { self::client()->expire($dwwIV, $frgnc); } }