public function checkTodo() { $checkTodo = S("checkTodo"); if (empty($checkTodo)) { $check_res = ""; $AccessEvent = new AccessEvent(); $UpdateEvent = new UpdateEvent(); if ($UpdateEvent->check()) { $check_res .= '<li><a href="' . U("Admin/System/update") . '"><i class="fa fa-laptop"></i> 发现新的可升级版本</a></li>'; } if (!$UpdateEvent->checkVersion()) { $check_res .= '<li><a href="' . U("Admin/System/update") . '"><i class="fa fa-laptop"></i> 数据库中版本号与代码中不一致</a></li>'; } if (!$AccessEvent->checkAccess()) { $check_res .= '<li><a href="' . U("Admin/Access/rolelist") . '"><i class="fa fa-laptop"></i> 需要重建角色权限!</a></li>'; } if (!$AccessEvent->checkNode()) { $check_res .= '<li><a href="' . U("Admin/Access/nodelist") . '"><i class="fa fa-laptop"></i> 需要重建节点!</a></li>'; } if ($check_res == "") { $check_res = "none"; } S("checkTodo", $check_res); die($check_res); } else { die(S("checkTodo")); } }
public function checkVersion() { $UpdateEvent = new UpdateEvent(); $cheack_res = $UpdateEvent->check(); if ($cheack_res) { $message = '<li><a href="' . U("Admin/System/update") . '"><i class="fa fa-laptop"></i> 发现新的可升级版本</a></li>'; } else { $message = 'none'; } die($message); }
/** * */ public function checkupdate() { $Update = new UpdateEvent(); $Update->check(); }
/** * 添加本地上传主题 */ public function themeAddLocal() { File::mkDir(WEB_CACHE_PATH); $config = array('rootPath' => WEB_CACHE_PATH, "savePath" => '', "maxSize" => 100000000, "exts" => array('zip'), "subName" => array()); $upload = new Upload($config); $info = $upload->upload(); if (!$info) { // 上传错误提示错误信息 $this->error($upload->getError()); } else { // 上传成功 获取上传文件信息 $file_path_full = $info['file']['fullpath']; //dump($info);die($file_path_full); if (File::file_exists($file_path_full)) { $Update = new UpdateEvent(); $applyRes = $Update->applyPatch($file_path_full); $applyInfo = json_decode($applyRes, true); if ($applyInfo['status']) { $this->success($applyInfo['info'], U('Admin/Custom/theme')); } else { $this->error($applyInfo['info']); } } else { $this->error('文件不存在'); } } }