public function cache() { $author = array("name" => "闵益飞", "web" => "www.minyifei.cn"); $key = "author"; //写入缓存 File::writeArrayCache($key, $author); //读取缓存 $cacheData = File::readArrayCache($key); $this->echoJson($cacheData); }