/** * 添加测试环境 */ private function addSite() { $data = array('siteName' => $_POST['siteName'], 'description' => $_POST['description'], 'author' => isset($_POST['author']) ? $_POST['author'] : 'M3D', 'modules' => $_POST['modules']); $model = new SiteModel(); if ($model->addSite($data)) { show_json('新建环境成功!', 200); } else { show_error('新建环境失败!'); } // 添加环境后,重启服务器 Tool::restartServer(); }