当前位置: 首页>>代码示例>>PHP>>正文


PHP CFileman::DeleteFile方法代码示例

本文整理汇总了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']];
				}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:fileman_folder.php

示例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;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:48,代码来源:fileman.php

示例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>
<?
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:37,代码来源:snippets.php


注:本文中的CFileman::DeleteFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。