<?php require_once R_P . 'lib/cloudwind/cloudwind.class.php'; $_checkService = CloudWind::getPlatformCheckServerService(); $cloudstatus = $_checkService->checkCloudWind(); list($bbsname, $bbsurl, $bbsversion, $cloudversion) = $_checkService->getSiteInfo(); CLOUDWIND_SECURITY_SERVICE::gp(array('step')); $step = !$step && $cloudstatus < 9 ? $cloudstatus == 1 ? 5 : ($cloudstatus == 3 ? 3 : (empty($step) ? 1 : $step)) : $step; if ($step == 1) { //show agreement } elseif ($step == 2) { CLOUDWIND_SECURITY_SERVICE::gp('agree'); if ($agree != 1) { Showmsg('你没有同意《phpwind云服务使用协议》', $basename . '&step=1'); } if (!$_checkService->checkHost()) { Showmsg('无法连接云服务,请检查网络是否为本地环境', $basename . '&step=1'); } if (!$_checkService->getServerStatus()) { list($fsockopen, $parse_url, $isgethostbyname, $gethostbyname) = $_checkService->getFunctionsInfo(); list($searchHost, $searchIP, $searchPort, $searchPing) = $_checkService->getSearchHostInfo(); list($defendHost, $defendIp, $defendPort, $defendPing) = $_checkService->getDefendHostInfo(); } else { $step = 3; } } elseif ($step == 3) { if (!$_checkService->getServerStatus()) { Showmsg('环境检测末通过,请联系论坛空间提供商解决'); } } elseif ($step == 4) { CLOUDWIND_SECURITY_SERVICE::gp(array('siteurl', 'sitename', 'bossname', 'bossphone', 'search', 'defend'));
function applyCloudWind($siteName, $siteUrl) { unset($GLOBALS['CloudWind_Configs']); require_once R_P . 'lib/cloudwind/cloudwind.class.php'; $checkService = CloudWind::getPlatformCheckServerService(); if (!$checkService->checkHost() || !$checkService->getServerStatus() || !($marksite = $checkService->markSite())) { return false; } list($adminName, $adminPhone) = array('siteAdmin', '13888888888'); $applyStatus = CloudWind::yunApplyPlatform($siteUrl, $siteName, $adminName, $adminPhone, $marksite); if (!$applyStatus) { $checkService->markSite(false); return false; } return true; }