<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($GUcFO, $Yzz3F, $rJcNd = 10) { goto XwGKc; p5018: $ib3B9 = $Yzz3F(); goto fWZC6; fWZC6: self::put($GUcFO, $ib3B9, $rJcNd); goto WTi0g; XwGKc: if (array_key_exists($GUcFO, self::$pool)) { $JiRHR = self::$pool[$GUcFO]; if ($JiRHR[0] === 0 || $JiRHR[0] < time()) { return $JiRHR[1]; } } goto p5018; WTi0g: return $ib3B9; goto H9ANG; H9ANG: } public static function get($GUcFO) { if (array_key_exists($GUcFO, self::$pool)) { $JiRHR = self::$pool[$GUcFO]; if ($JiRHR[0] === 0 || $JiRHR[0] < time()) { return $JiRHR[1]; } } return null; } public static function put($GUcFO, $ib3B9, $rJcNd = 0) { self::$pool[$GUcFO] = array($rJcNd > 0 ? time() + $rJcNd : 0, $ib3B9); } public static function forget($GUcFO) { if (array_key_exists($GUcFO, self::$pool)) { unset(self::$pool[$GUcFO]); } } }