當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CDiskQuota::UpdateDiskQuota方法代碼示例

本文整理匯總了PHP中CDiskQuota::UpdateDiskQuota方法的典型用法代碼示例。如果您正苦於以下問題:PHP CDiskQuota::UpdateDiskQuota方法的具體用法?PHP CDiskQuota::UpdateDiskQuota怎麽用?PHP CDiskQuota::UpdateDiskQuota使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CDiskQuota的用法示例。


在下文中一共展示了CDiskQuota::UpdateDiskQuota方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: BXDeleteFromSystem

function BXDeleteFromSystem($absoluteFilePath, $path, $site)
{
    $io = CBXVirtualIo::GetInstance();
    $f = $io->GetFile($absoluteFilePath);
    $f->MarkWritable();
    if (COption::GetOptionInt("main", "disk_space") > 0) {
        $file_size = $f->GetFileSize();
        $quota = new CDiskQuota();
        $quota->UpdateDiskQuota("file", $file_size, "delete");
    }
    $sucess = $io->Delete($absoluteFilePath);
    if (!$sucess) {
        return false;
    }
    if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
        $res_log['path'] = substr($path, 1);
        CEventLog::Log("content", "PAGE_DELETE", "main", "", serialize($res_log));
    }
    $GLOBALS["APPLICATION"]->RemoveFileAccessPermission(array($site, $path));
    if (CModule::IncludeModule("search")) {
        CSearch::DeleteIndex("main", $site . "|" . $path);
    }
    //Delete from rewrite rule
    CUrlRewriter::Delete(array("SITE_ID" => $site, "PATH" => $path));
    if (class_exists("\\Bitrix\\Main\\Application", false)) {
        \Bitrix\Main\Component\ParametersTable::deleteByFilter(array("SITE_ID" => $site, "REAL_PATH" => $path));
    }
    return true;
}
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:29,代碼來源:file_delete.php

示例2: UndoNewFile

    function UndoNewFile($Params, $type)
    {
        global $APPLICATION;
        $documentRoot = CSite::GetSiteDocRoot($Params['site']);
        $io = CBXVirtualIo::GetInstance();
        // Delete file
        $f = $io->GetFile($Params['absPath']);
        $f->MarkWritable();
        if (COption::GetOptionInt("main", "disk_space") > 0) {
            $file_size = $f->GetFileSize();
            $quota = new CDiskQuota();
            $quota->UpdateDiskQuota("file", $file_size, "delete");
        }
        $sucess = $io->Delete($Params['absPath']);
        if (!$sucess) {
            return;
        }
        $APPLICATION->RemoveFileAccessPermission(array($Params['site'], $Params['path']));
        if (CModule::IncludeModule("search")) {
            CSearch::DeleteIndex("main", $Params['site'] . "|" . $Params['path']);
        }
        // Find and clean file from menu
        if ($Params['menu']) {
            $arMenu = CFileman::GetMenuArray($documentRoot . $Params['menu']['menuFile']);
            if (!empty($arMenu["aMenuLinks"])) {
                $found = false;
                foreach ($arMenu["aMenuLinks"] as $menuIndex => $arItem) {
                    if ($arItem[1] == $Params['menu']['menuPath'] && $arItem[0] == $Params['menu']['menuName']) {
                        unset($arMenu["aMenuLinks"][$menuIndex]);
                        $found = true;
                        break;
                    }
                }
                if ($found) {
                    CFileMan::SaveMenu(array($Params['site'], $Params['menu']['menuFile']), $arMenu["aMenuLinks"], $arMenu["sMenuTemplate"]);
                }
            }
        }
        if (isset($Params['public']) && $Params['public'] == 'Y') {
            ?>
			<script type="text/javascript">
				window.location = '<?php 
            echo CUtil::JSEscape(CHTTP::URN2URI(GetDirPath($Params['path'])));
            ?>
';
			</script>
		<?php 
        }
        $GLOBALS["CACHE_MANAGER"]->CleanDir("menu");
    }
開發者ID:Satariall,項目名稱:izurit,代碼行數:50,代碼來源:fileman.php

示例3: array

		$arUndoParams = array(
			'module' => 'fileman',
			'undoType' => 'delete_menu',
			'undoHandler' => 'CFileman::UndoFileDelete',
			'arContent' => array(
				'site' => $site,
				'path' => $menufilename,
				'content' => $f->GetContents(),
				'perm' => CFileMan::FetchFileAccessPerm($arPath_m, true),
			)
		);

		if (COption::GetOptionInt("main", "disk_space") > 0)
		{
			$quota = new CDiskQuota();
			$quota->UpdateDiskQuota("file", $f->GetFileSize(), "delete");
		}

		$f->MarkWritable();
		$success = $io->Delete($abs_path);

		if(COption::GetOptionString($module_id, "log_menu", "Y")=="Y")
		{
			$mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
			$mt = unserialize(str_replace("\\", "", $mt));
			$res_log['menu_name'] = $mt[$name];
			$res_log['path'] = substr($path, 1);
			CEventLog::Log(
				"content",
				"MENU_DELETE",
				"main",
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:31,代碼來源:menu_edit.php


注:本文中的CDiskQuota::UpdateDiskQuota方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。