本文整理匯總了PHP中CDiskQuota::CheckDiskQuota方法的典型用法代碼示例。如果您正苦於以下問題:PHP CDiskQuota::CheckDiskQuota方法的具體用法?PHP CDiskQuota::CheckDiskQuota怎麽用?PHP CDiskQuota::CheckDiskQuota使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CDiskQuota
的用法示例。
在下文中一共展示了CDiskQuota::CheckDiskQuota方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: BXCreateSection
function BXCreateSection(&$fileContent, &$sectionFileContent, &$absoluteFilePath, &$sectionPath)
{
//Check quota
$quota = new CDiskQuota();
if (!$quota->CheckDiskQuota(array("FILE_SIZE" => strlen($fileContent) + strlen($sectionFileContent)))) {
$GLOBALS["APPLICATION"]->ThrowException($quota->LAST_ERROR, "BAD_QUOTA");
return false;
}
$io = CBXVirtualIo::GetInstance();
//Create dir
if (!$io->CreateDirectory($absoluteFilePath)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("PAGE_NEW_FOLDER_CREATE_ERROR") . "<br /> (" . htmlspecialcharsbx($absoluteFilePath) . ")", "DIR_NOT_CREATE");
return false;
}
//Create .section.php
$f = $io->GetFile($absoluteFilePath . "/.section.php");
if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/.section.php", $sectionFileContent)) {
return false;
}
//Create index.php
if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/index.php", $fileContent)) {
return false;
} else {
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
$res_log['path'] = $sectionPath . "/index.php";
CEventLog::Log("content", "PAGE_ADD", "main", "", serialize($res_log));
}
}
return true;
}