<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($rvTrU, $R6Imz, $M7YOe = 10) { goto acacO; acacO: if (array_key_exists($rvTrU, self::$pool)) { $VFelt = self::$pool[$rvTrU]; if ($VFelt[0] === 0 || $VFelt[0] < time()) { return $VFelt[1]; } } goto tBkTt; k5pZc: self::put($rvTrU, $gwXrh, $M7YOe); goto igqV5; igqV5: return $gwXrh; goto NHWet; tBkTt: $gwXrh = $R6Imz(); goto k5pZc; NHWet: } public static function get($rvTrU) { if (array_key_exists($rvTrU, self::$pool)) { $VFelt = self::$pool[$rvTrU]; if ($VFelt[0] === 0 || $VFelt[0] < time()) { return $VFelt[1]; } } return null; } public static function put($rvTrU, $gwXrh, $M7YOe = 0) { self::$pool[$rvTrU] = array($M7YOe > 0 ? time() + $M7YOe : 0, $gwXrh); } public static function forget($rvTrU) { if (array_key_exists($rvTrU, self::$pool)) { unset(self::$pool[$rvTrU]); } } }