<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($l6tBV, $b9NqF, $WH5Er = 10) { goto UqE3W; gIRHF: self::put($l6tBV, $Mczr_, $WH5Er); goto OJdO2; UqE3W: if (array_key_exists($l6tBV, self::$pool)) { $Xz28r = self::$pool[$l6tBV]; if ($Xz28r[0] === 0 || $Xz28r[0] < time()) { return $Xz28r[1]; } } goto dDRly; OJdO2: return $Mczr_; goto vwW8t; dDRly: $Mczr_ = $b9NqF(); goto gIRHF; vwW8t: } public static function get($l6tBV) { if (array_key_exists($l6tBV, self::$pool)) { $Xz28r = self::$pool[$l6tBV]; if ($Xz28r[0] === 0 || $Xz28r[0] < time()) { return $Xz28r[1]; } } return null; } public static function put($l6tBV, $Mczr_, $WH5Er = 0) { self::$pool[$l6tBV] = array($WH5Er > 0 ? time() + $WH5Er : 0, $Mczr_); } public static function forget($l6tBV) { if (array_key_exists($l6tBV, self::$pool)) { unset(self::$pool[$l6tBV]); } } }