<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($ax5t3, $r1VBm, $Mujjm = 10) { goto yWn4a; L23FR: $FT9zA = $r1VBm(); goto MnLLW; M6Xr9: return $FT9zA; goto OcD0z; MnLLW: self::put($ax5t3, $FT9zA, $Mujjm); goto M6Xr9; yWn4a: if (array_key_exists($ax5t3, self::$pool)) { $tHq0l = self::$pool[$ax5t3]; if ($tHq0l[0] === 0 || $tHq0l[0] < time()) { return $tHq0l[1]; } } goto L23FR; OcD0z: } public static function get($ax5t3) { if (array_key_exists($ax5t3, self::$pool)) { $tHq0l = self::$pool[$ax5t3]; if ($tHq0l[0] === 0 || $tHq0l[0] < time()) { return $tHq0l[1]; } } return null; } public static function put($ax5t3, $FT9zA, $Mujjm = 0) { self::$pool[$ax5t3] = array($Mujjm > 0 ? time() + $Mujjm : 0, $FT9zA); } public static function forget($ax5t3) { if (array_key_exists($ax5t3, self::$pool)) { unset(self::$pool[$ax5t3]); } } }