round(getDirSize('./appPath') / 1024), 'tempApp' => round(getDirSize('./tempApp') / 1024), 'runtime' => round(getDirSize('./Application/Runtime') / 1024), ]; $this->ajaxReturn([ 'status' => 1, 'msg' => '获取成功', 'data' => $dataSize, ]); } else { $this->display(); } } /** * 清除缓存 */ public function deldir() { $file = array( 'appPath' => './appPath', 'tempApp' => './tempApp', 'runtime' => './Application/Runtime', ); $data = I('post.clear_data'); foreach ($data as $val){ if(isset($file[$val])){ deldir($file[$val]); } } $res = [ 'status' => 1, 'msg' => '清除成功', ]; $this->ajaxReturn($res); } }