/** * Return memc value if not expired * @param object|bool $data makeMemcObj() tuple * @param Page $article * @param string $allowStale Use 'allowStale' to skip page_touched check * @return mixed */ public static function getMemcValue($data, Page $article, $allowStale = '') { if (is_object($data)) { if ($allowStale === 'allowStale' || $data->time >= $article->getTouched()) { return $data->value; } } return false; }