本文整理汇总了PHP中CFileman::DeleteFile方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileman::DeleteFile方法的具体用法?PHP CFileman::DeleteFile怎么用?PHP CFileman::DeleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileman
的用法示例。
在下文中一共展示了CFileman::DeleteFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
for($i = 0; $i<$numpropsvals; $i++)
{
if(strlen(Trim($_POST["CODE_".$i]))>0 && strlen(Trim($_POST["VALUE_".$i]))>0)
{
if($bNeedComma) $strDirProperties .= ",\n";
$strDirProperties .= " \"".CFileMan::EscapePHPString(Trim($_POST["CODE_".$i]))."\" => \"".CFileMan::EscapePHPString(Trim($_POST["VALUE_".$i]))."\"";
$bNeedComma = True;
$bNeedSectionFile = True;
}
}
$strDirProperties .= "\n);\n";
if($bNeedSectionFile)
$APPLICATION->SaveFileContent($DOC_ROOT.$path."/.section.php", "<"."?\n".$strSectionName.$strDirProperties."?".">");
else
CFileman::DeleteFile(Array($site, $path."/.section.php"));
if($USER->CanDoFileOperation('fm_edit_permission',$arPath))
{
$arPermissions=Array();
$db_groups = CGroup::GetList($order="sort", $by="asc");
while($arGroup = $db_groups->Fetch())
{
$gperm = isset($_POST["g_".$arGroup["ID"]]) ? $_POST["g_".$arGroup["ID"]] : '';
if (!isset($gperm))
{
if($path=="")
$gperm = $CUR_PERM["/"][$arGroup['ID']];
else
$gperm = $CUR_PERM[$arParsedPath["LAST"]][$arGroup['ID']];
}
示例2: DeleteEx
function DeleteEx($path)
{
global $APPLICATION, $USER;
CMain::InitPathVars($site, $path);
if (strlen($path) <= 0) {
return false;
}
$src = $_SERVER["DOCUMENT_ROOT"] . $path;
$src = str_replace("//", "/", $src);
if ($src == $_SERVER["DOCUMENT_ROOT"]) {
return false;
}
$DOC_ROOT = CSite::GetSiteDocRoot($site);
@set_time_limit(600);
$io = CBXVirtualIo::GetInstance();
if (is_link($linkPath = CBXVirtualIoFileSystem::ConvertCharset($DOC_ROOT . $path))) {
if (@unlink($linkPath)) {
return;
} else {
return GetMessage("FILEMAN_FILEMAN_SYMLINK_DEL_ERROR") . " \"" . $path . "\".\n";
}
} elseif ($io->DirectoryExists($DOC_ROOT . $path)) {
//check rights
if (!$USER->CanDoFileOperation('fm_delete_folder', array($site, $path))) {
return GetMessage("FILEMAN_FILEMAN_FOLDER_DEL_DENY") . " \"" . $path . "\".\n";
}
} else {
return CFileman::DeleteFile(array($site, $path));
}
$strWarning = "";
//get folder content
$d = $io->GetDirectory($DOC_ROOT . $path);
$arChildren = $d->GetChildren();
foreach ($arChildren as $child) {
$fn = $child->GetName();
if ($child->IsDirectory()) {
$strWarning .= CFileman::DeleteEx(array($site, $path . "/" . $fn));
} else {
if ($fn == ".access.php") {
continue;
}
$strWarning .= CFileman::DeleteFile(array($site, $path . "/" . $fn));
}
}
//delete first folder
$strWarning .= CFileMan::DeleteDir(array($site, $path));
return $strWarning;
}
示例3: Delete
public static function Delete($Params)
{
global $APPLICATION;
$snPath = BX_PERSONAL_ROOT."/templates/".CFileMan::SecurePathVar($Params['template'])."/snippets";
$contPath = $_SERVER["DOCUMENT_ROOT"].$snPath;
$path = CFileMan::SecurePathVar($Params["path"]);
$key = $Params["path"].($Params["path"] == '' ? '' : '/').CFileMan::SecurePathVar($Params["name"]);
//Delete snippet file
CFileman::DeleteFile(Array($Params["site"], $snPath.'/'.$key));
//Delete thumbnail
if ($Params["thumb"] != '')
CFileman::DeleteFile(Array($Params["site"], $snPath.'/images/'.$path.($path == '' ? '' : '/').CFileMan::SecurePathVar($Params["thumb"])));
if (file_exists($contPath."/.content.php"))
{
@include($contPath."/.content.php");
$contentSrc = '<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>'.chr(10);
$contentSrc .= '<?'.chr(10).'$SNIPPETS = Array();'.chr(10);
foreach ($SNIPPETS as $k=>$_arSn)
{
if ($k != $key && CSnippets::CheckFile(array('site' => $Params["site"], 'template' => $Params['template'], 'path' => $k)))
$contentSrc .= '$SNIPPETS[\''.CUtil::JSEscape($k).'\'] = Array("title"=>\''.CUtil::JSEscape($_arSn['title']).'\', "description"=>\''.CUtil::JSEscape($_arSn['description']).'\');'.chr(10);
}
$contentSrc .= '?>';
$APPLICATION->SaveFileContent($contPath."/.content.php", $contentSrc);
}
CSnippets::ClearCache();
?>
<script>
window.operation_success = true;
</script>
<?
}