<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class MemCacheUtil { private static $pool = array(); public static function remember($HQKqq, $yeJzO, $O7epJ = 10) { goto sUiNQ; gWbNx: return $mdHu1; goto GZZ1N; GRidr: self::put($HQKqq, $mdHu1, $O7epJ); goto gWbNx; sUiNQ: if (array_key_exists($HQKqq, self::$pool)) { $pk5fc = self::$pool[$HQKqq]; if ($pk5fc[0] === 0 || $pk5fc[0] < time()) { return $pk5fc[1]; } } goto zIbDr; zIbDr: $mdHu1 = $yeJzO(); goto GRidr; GZZ1N: } public static function get($HQKqq) { if (array_key_exists($HQKqq, self::$pool)) { $pk5fc = self::$pool[$HQKqq]; if ($pk5fc[0] === 0 || $pk5fc[0] < time()) { return $pk5fc[1]; } } return null; } public static function put($HQKqq, $mdHu1, $O7epJ = 0) { self::$pool[$HQKqq] = array($O7epJ > 0 ? time() + $O7epJ : 0, $mdHu1); } public static function forget($HQKqq) { if (array_key_exists($HQKqq, self::$pool)) { unset(self::$pool[$HQKqq]); } } }