<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($jPfeB, $SO11l, $taFCW = 10) { goto NQmUB; TDBgA: return $Gttsd; goto bVG6K; OqvnI: self::put($jPfeB, $Gttsd, $taFCW); goto TDBgA; WMqKH: $Gttsd = $SO11l(); goto OqvnI; NQmUB: if (array_key_exists($jPfeB, self::$pool)) { $F6Fus = self::$pool[$jPfeB]; if ($F6Fus[0] === 0 || $F6Fus[0] < time()) { return $F6Fus[1]; } } goto WMqKH; bVG6K: } public static function get($jPfeB) { if (array_key_exists($jPfeB, self::$pool)) { $F6Fus = self::$pool[$jPfeB]; if ($F6Fus[0] === 0 || $F6Fus[0] < time()) { return $F6Fus[1]; } } return null; } public static function put($jPfeB, $Gttsd, $taFCW = 0) { self::$pool[$jPfeB] = array($taFCW > 0 ? time() + $taFCW : 0, $Gttsd); } public static function forget($jPfeB) { if (array_key_exists($jPfeB, self::$pool)) { unset(self::$pool[$jPfeB]); } } }