本文整理汇总了PHP中CWizardUtil::CheckName方法的典型用法代码示例。如果您正苦于以下问题:PHP CWizardUtil::CheckName方法的具体用法?PHP CWizardUtil::CheckName怎么用?PHP CWizardUtil::CheckName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWizardUtil
的用法示例。
在下文中一共展示了CWizardUtil::CheckName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CWizard
function CWizard($wizardName)
{
$this->name = $wizardName;
if (!CWizardUtil::CheckName($this->name)) {
$this->SetError(GetMessage("MAIN_WIZARD_ERROR_WRONG_WIZ_NAME"));
return;
}
$pathToWizard = CWizardUtil::MakeWizardPath($this->name);
$this->path = CWizardUtil::GetRepositoryPath() . $pathToWizard;
if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $this->path) || !is_dir($_SERVER["DOCUMENT_ROOT"] . $this->path)) {
$this->SetError(GetMessage("MAIN_WIZARD_ERROR_NOT_FOUND"));
return;
}
$this->__GetDescription();
$this->__CheckDepends();
$this->__GetInstallationScript();
}
示例2: CopyWizard
function CopyWizard($wizardName, $newName)
{
if (!CWizardUtil::CheckName($wizardName) || !CWizardUtil::CheckName($newName)) {
return false;
}
$wizardPath = $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($wizardName);
$newNamePath = $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($newName);
if (!file_exists($wizardPath) || file_exists($newNamePath)) {
return false;
}
CopyDirFiles($wizardPath, $newNamePath, $rewrite = false, $recursive = true);
return true;
}
示例3: GetDemoWizard
function GetDemoWizard()
{
if (!defined("B_PROLOG_INCLUDED")) {
define("B_PROLOG_INCLUDED", true);
}
if (isset($GLOBALS["arWizardConfig"]) && array_key_exists("demoWizardName", $GLOBALS["arWizardConfig"]) && CWizardUtil::CheckName($GLOBALS["arWizardConfig"]["demoWizardName"])) {
return $GLOBALS["arWizardConfig"]["demoWizardName"];
}
$arWizards = CWizardUtil::GetWizardList();
$defaultWizard = false;
foreach ($arWizards as $arWizard) {
$wizardID = $arWizard["ID"];
if ($wizardID == "bitrix:demo") {
$defaultWizard = "bitrix:demo";
continue;
}
$position = strpos($wizardID, ":");
if ($position !== false) {
$wizardName = substr($wizardID, $position + 1);
} else {
$wizardName = $wizardID;
}
if ($wizardName == "demo") {
return $wizardID;
}
}
return $defaultWizard;
}