/** * Использование APC в качестве кэша для роутера :) * @param $path */ private function loadCachedResources($path) { if (apc_exists('routes-' . crc32_fix($path))) { $this->rules = array_merge($this->rules, json_decode(apc_fetch('routes-' . crc32_fix($path)), true)); return; } $this->loadStaticResources($path); }
/** * Проверка наличия элемента в кэше MEM * @param $name * @return bool */ private function mem_exists(&$name) { return isset($this->data[crc32_fix($name)]); }