本文整理汇总了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;
}
示例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");
}
示例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",