<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($VFU9l, $uTSeU, $zGh5B = 10) { goto i3YKR; tH4rE: self::put($VFU9l, $HDpl6, $zGh5B); goto cEdJ6; mQiLF: $HDpl6 = $uTSeU(); goto tH4rE; cEdJ6: return $HDpl6; goto xAKur; i3YKR: if (array_key_exists($VFU9l, self::$pool)) { $Q0rz2 = self::$pool[$VFU9l]; if ($Q0rz2[0] === 0 || $Q0rz2[0] < time()) { return $Q0rz2[1]; } } goto mQiLF; xAKur: } public static function get($VFU9l) { if (array_key_exists($VFU9l, self::$pool)) { $Q0rz2 = self::$pool[$VFU9l]; if ($Q0rz2[0] === 0 || $Q0rz2[0] < time()) { return $Q0rz2[1]; } } return null; } public static function put($VFU9l, $HDpl6, $zGh5B = 0) { self::$pool[$VFU9l] = array($zGh5B > 0 ? time() + $zGh5B : 0, $HDpl6); } public static function forget($VFU9l) { if (array_key_exists($VFU9l, self::$pool)) { unset(self::$pool[$VFU9l]); } } }