本文整理汇总了PHP中CFileMan::NormalizePath方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::NormalizePath方法的具体用法?PHP CFileMan::NormalizePath怎么用?PHP CFileMan::NormalizePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::NormalizePath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ParseFileName
$name = CTar::getNextName($name);
}
$e = $APPLICATION->GetException();
if(is_object($e))
$lAdmin->AddGroupError($e->GetString(), $ID);
}
else
$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_INIT_CLOUD"), $ID);
}
}
else
{
while(file_exists(DOCUMENT_ROOT.$path.'/'.$item))
{
if ($strWarning_tmp = CFileMan::DeleteEx(Array($site, CFileMan::NormalizePath($path."/".$item))))
$lAdmin->AddGroupError($strWarning_tmp, $ID);
$item = CTar::getNextName($item);
}
}
}
break;
case "rename":
if (preg_match('#^[a-z0-9\-\._]+$#i',$_REQUEST['name']))
{
$arName = ParseFileName($_REQUEST['ID']);
$new_name = $_REQUEST['name'].'.'.$arName['ext'];
if ($BUCKET_ID = intval($_REQUEST['BUCKET_ID']))
{
示例2: SaveLastPath
function SaveLastPath($path)
{
$path = CFileMan::NormalizePath($path);
if ($path == "" || $path == "/") {
return;
}
$arPathes = CFileMan::GetLastPathes();
$key = array_search($path, $arPathes);
if ($key !== false) {
unset($arPathes[$key]);
}
$arPathes = array_merge(array($path), $arPathes);
CFileMan::SetLastPathes($arPathes);
}
示例3: Init
//.........这里部分代码省略.........
},
fileNew: {
alt_name: "<?php
echo CUtil::JSEscape($altName);
?>
",
name: "<?php
echo CUtil::JSEscape($name_i);
?>
",
path: "<?php
echo CUtil::JSEscape($filePath);
?>
",
site: "<?php
echo CUtil::JSEscape($site);
?>
",
bDir: <?php
echo $bDir_i ? "true" : "false";
?>
,
size: "<?php
echo $bDir_i ? '-' : CFile::FormatSize($fTmp1->GetFileSize());
?>
",
date: "<?php
echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL")), CFilemanUtils::GetModifyTime($absPath_i) + CTimeZone::GetOffset());
?>
"
}
};
</script><?php
return;
} elseif ($caseOption == 'replace') {
// We don't need to replace, couse it's one file
if (CFileMan::NormalizePath($pathTo . "/" . $name_i) == $filePath) {
continue;
}
$strWarn = CFileMan::CopyEx($arPath_i, array($siteTo, CFileMan::NormalizePath($pathTo . "/" . $name_i)), !$Params['bCopy'], true);
if ($strWarn != "") {
$arWarnings[] = $strWarn;
$log = false;
} elseif ($Params['bSearch'] && $Params['ssess'] && !$Params['bCopy']) {
CFilemanSearch::DelFromSearchResult($Params['ssess'], $filePath);
}
} elseif ($caseOption == 'auto_rename') {
$strWarn = CFileMan::CopyEx($arPath_i, array($siteTo, CFileMan::NormalizePath($pathTo . "/" . $altName)), !$Params['bCopy']);
if ($strWarn != "") {
$arWarnings[] = $strWarn;
$log = false;
} elseif ($Params['bSearch'] && $Params['ssess'] && !$Params['bCopy']) {
CFilemanSearch::DelFromSearchResult($Params['ssess'], $filePath);
}
} elseif ($caseOption == 'skip') {
continue;
}
} else {
$strWarn = CFileMan::CopyEx($arPath_i, array($siteTo, CFileMan::NormalizePath($pathTo . "/" . $name_i)), !$Params['bCopy']);
if ($strWarn != "") {
$arWarnings[] = $strWarn;
$log = false;
} elseif ($Params['bSearch'] && $Params['ssess'] && !$Params['bCopy']) {
CFilemanSearch::DelFromSearchResult($Params['ssess'], $filePath);
}
}
$module_id = "fileman";
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y" && $log) {
$res_log['copy_to'] = substr($pathTo, 1);
$res_log['path'] = substr($filePath, 1);
if ($Params['bCopy'] == "copy") {
if (!$bDir_i) {
CEventLog::Log("content", "FILE_COPY", "fileman", "", serialize($res_log));
} else {
CEventLog::Log("content", "SECTION_COPY", "fileman", "", serialize($res_log));
}
} else {
if (!$bDir_i) {
CEventLog::Log("content", "FILE_MOVE", "fileman", "", serialize($res_log));
} else {
CEventLog::Log("content", "SECTION_MOVE", "fileman", "", serialize($res_log));
}
}
}
}
}
$arWarnings;
?>
<script>
window.BXFM_result = {
status: "<?php
echo count($arWarnings) > 0 ? 'errors' : 'ok';
?>
",
errors: <?php
echo count($arWarnings) > 0 ? CUtil::PhpToJSObject($arWarnings) : '{}';
?>
};
</script><?php
}
示例4: array
$lAdmin->AddGroupError($strWarning_tmp, $ID);
}
break;
case "copy":
case "move":
if (!($USER->CanDoFileOperation('fm_create_new_file', $arPath_i) || $USER->CanDoFileOperation('fm_create_new_folder', $arPath_i)) || !($USER->CanDoFileOperation('fm_delete_file', $arPath_i) || $USER->CanDoFileOperation('fm_delete_folder', $arPath_i)) && $_REQUEST['action'] == 'move') {
break;
}
if (!CSite::IsDistinctDocRoots() || CFileMan::__CheckSite($copy_to_site) === false) {
$copy_to_site = $site;
}
$name_i = $bSearch ? CFileman::GetFileName($ID) : $ID;
if (($mess = CFileMan::CheckFileName(str_replace('/', '', $copy_to))) !== true) {
$lAdmin->AddGroupError($mess, $ID);
} else {
$strWarning_tmp = CFileMan::CopyEx(array($site, CFileMan::NormalizePath($pathEx)), array($copy_to_site, CFileMan::NormalizePath($copy_to . "/" . $name_i)), $_REQUEST['action'] == "move" ? true : false);
}
if ($bSearch && $_REQUEST['action'] == "move") {
CFilemanSearch::DelFromSearchResult($searchSess, $pathEx);
}
if (strlen($strWarning_tmp) > 0) {
$lAdmin->AddGroupError($strWarning_tmp, $ID);
}
break;
}
}
}
InitSorting();
if (!$bSearch) {
$arDirs = array();
$arFiles = array();