本文整理汇总了PHP中CIBlock::CleanCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::CleanCache方法的具体用法?PHP CIBlock::CleanCache怎么用?PHP CIBlock::CleanCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::CleanCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DeleteByIBlock
public static function DeleteByIBlock($IBLOCK_ID)
{
global $DB;
$IBLOCK_ID = intval($IBLOCK_ID);
$DB->Query("DELETE FROM b_iblock_section_property WHERE IBLOCK_ID = ".$IBLOCK_ID);
$DB->Query("UPDATE b_iblock SET SECTION_PROPERTY = 'N' WHERE ID = ".$IBLOCK_ID);
CIBlock::CleanCache($IBLOCK_ID);
}
示例2: LastStep21
function LastStep21($arIBlock)
{
global $DB, $_SESSION, $arErrors, $arMessages, $INTERVAL;
$DB->Query("UPDATE b_iblock_property SET VERSION=1 WHERE IBLOCK_ID = " . $arIBlock["ID"]);
$DB->Query("UPDATE b_iblock SET VERSION=1,LAST_CONV_ELEMENT = 0 WHERE ID = " . $arIBlock["ID"]);
CIBlock::CleanCache($arIBlock["ID"]);
$DB->DDL("DROP TABLE b_iblock_element_prop_s" . $arIBlock["ID"]);
$DB->DDL("DROP TABLE b_iblock_element_prop_m" . $arIBlock["ID"]);
$DB->DDL("DROP SEQUENCE sq_b_iblock_element_prop_m" . $arIBlock["ID"], true);
return 6;
}
示例3: SetFields
//.........这里部分代码省略.........
if (array_key_exists("CODE", $arFields)) {
$arDef =& $arFields["CODE"]["DEFAULT_VALUE"];
if (is_array($arDef)) {
$trans_len = intval($arDef["TRANS_LEN"]);
if ($trans_len > 255) {
$trans_len = 255;
} elseif ($trans_len < 1) {
$trans_len = 100;
}
$arDef = serialize(array("UNIQUE" => $arDef["UNIQUE"] === "Y" ? "Y" : "N", "TRANSLITERATION" => $arDef["TRANSLITERATION"] === "Y" ? "Y" : "N", "TRANS_LEN" => $trans_len, "TRANS_CASE" => $arDef["TRANS_CASE"] == "U" ? "U" : ($arDef["TRANS_CASE"] == "" ? "" : "L"), "TRANS_SPACE" => substr($arDef["TRANS_SPACE"], 0, 1), "TRANS_OTHER" => substr($arDef["TRANS_OTHER"], 0, 1), "TRANS_EAT" => $arDef["TRANS_EAT"] === "N" ? "N" : "Y", "USE_GOOGLE" => $arDef["USE_GOOGLE"] === "Y" ? "Y" : "N"));
} else {
$arDef = "";
}
}
if (array_key_exists("SECTION_PICTURE", $arFields)) {
$arDef =& $arFields["SECTION_PICTURE"]["DEFAULT_VALUE"];
if (is_array($arDef)) {
$arDef = serialize(array("FROM_DETAIL" => $arDef["FROM_DETAIL"] === "Y" ? "Y" : "N", "SCALE" => $arDef["SCALE"] === "Y" ? "Y" : "N", "WIDTH" => intval($arDef["WIDTH"]) > 0 ? intval($arDef["WIDTH"]) : "", "HEIGHT" => intval($arDef["HEIGHT"]) > 0 ? intval($arDef["HEIGHT"]) : "", "IGNORE_ERRORS" => $arDef["IGNORE_ERRORS"] === "Y" ? "Y" : "N", "METHOD" => $arDef["METHOD"] === "resample" ? "resample" : "", "COMPRESSION" => intval($arDef["COMPRESSION"]) > 100 ? 100 : (intval($arDef["COMPRESSION"]) > 0 ? intval($arDef["COMPRESSION"]) : ""), "DELETE_WITH_DETAIL" => $arDef["DELETE_WITH_DETAIL"] === "Y" ? "Y" : "N", "UPDATE_WITH_DETAIL" => $arDef["UPDATE_WITH_DETAIL"] === "Y" ? "Y" : "N", "USE_WATERMARK_TEXT" => $arDef["USE_WATERMARK_TEXT"] === "Y" ? "Y" : "N", "WATERMARK_TEXT" => $arDef["WATERMARK_TEXT"], "WATERMARK_TEXT_FONT" => $arDef["WATERMARK_TEXT_FONT"], "WATERMARK_TEXT_COLOR" => $arDef["WATERMARK_TEXT_COLOR"], "WATERMARK_TEXT_SIZE" => intval($arDef["WATERMARK_TEXT_SIZE"]) > 0 ? intval($arDef["WATERMARK_TEXT_SIZE"]) : "", "WATERMARK_TEXT_POSITION" => $arDef["WATERMARK_TEXT_POSITION"], "USE_WATERMARK_FILE" => $arDef["USE_WATERMARK_FILE"] === "Y" ? "Y" : "N", "WATERMARK_FILE" => $arDef["WATERMARK_FILE"], "WATERMARK_FILE_ALPHA" => intval($arDef["WATERMARK_FILE_ALPHA"]) > 0 ? intval($arDef["WATERMARK_FILE_ALPHA"]) : "", "WATERMARK_FILE_POSITION" => $arDef["WATERMARK_FILE_POSITION"], "WATERMARK_FILE_ORDER" => $arDef["WATERMARK_FILE_ORDER"]));
} else {
$arDef = "";
}
}
if (array_key_exists("SECTION_DETAIL_PICTURE", $arFields)) {
$arDef =& $arFields["SECTION_DETAIL_PICTURE"]["DEFAULT_VALUE"];
if (is_array($arDef)) {
$arDef = serialize(array("SCALE" => $arDef["SCALE"] === "Y" ? "Y" : "N", "WIDTH" => intval($arDef["WIDTH"]) > 0 ? intval($arDef["WIDTH"]) : "", "HEIGHT" => intval($arDef["HEIGHT"]) > 0 ? intval($arDef["HEIGHT"]) : "", "IGNORE_ERRORS" => $arDef["IGNORE_ERRORS"] === "Y" ? "Y" : "N", "METHOD" => $arDef["METHOD"] === "resample" ? "resample" : "", "COMPRESSION" => intval($arDef["COMPRESSION"]) > 100 ? 100 : (intval($arDef["COMPRESSION"]) > 0 ? intval($arDef["COMPRESSION"]) : ""), "USE_WATERMARK_TEXT" => $arDef["USE_WATERMARK_TEXT"] === "Y" ? "Y" : "N", "WATERMARK_TEXT" => $arDef["WATERMARK_TEXT"], "WATERMARK_TEXT_FONT" => $arDef["WATERMARK_TEXT_FONT"], "WATERMARK_TEXT_COLOR" => $arDef["WATERMARK_TEXT_COLOR"], "WATERMARK_TEXT_SIZE" => intval($arDef["WATERMARK_TEXT_SIZE"]) > 0 ? intval($arDef["WATERMARK_TEXT_SIZE"]) : "", "WATERMARK_TEXT_POSITION" => $arDef["WATERMARK_TEXT_POSITION"], "USE_WATERMARK_FILE" => $arDef["USE_WATERMARK_FILE"] === "Y" ? "Y" : "N", "WATERMARK_FILE" => $arDef["WATERMARK_FILE"], "WATERMARK_FILE_ALPHA" => intval($arDef["WATERMARK_FILE_ALPHA"]) > 0 ? intval($arDef["WATERMARK_FILE_ALPHA"]) : "", "WATERMARK_FILE_POSITION" => $arDef["WATERMARK_FILE_POSITION"], "WATERMARK_FILE_ORDER" => $arDef["WATERMARK_FILE_ORDER"]));
} else {
$arDef = "";
}
}
if (array_key_exists("SECTION_CODE", $arFields)) {
$arDef =& $arFields["SECTION_CODE"]["DEFAULT_VALUE"];
if (is_array($arDef)) {
$trans_len = intval($arDef["TRANS_LEN"]);
if ($trans_len > 255) {
$trans_len = 255;
} elseif ($trans_len < 1) {
$trans_len = 100;
}
$arDef = serialize(array("UNIQUE" => $arDef["UNIQUE"] === "Y" ? "Y" : "N", "TRANSLITERATION" => $arDef["TRANSLITERATION"] === "Y" ? "Y" : "N", "TRANS_LEN" => $trans_len, "TRANS_CASE" => $arDef["TRANS_CASE"] == "U" ? "U" : ($arDef["TRANS_CASE"] == "" ? "" : "L"), "TRANS_SPACE" => substr($arDef["TRANS_SPACE"], 0, 1), "TRANS_OTHER" => substr($arDef["TRANS_OTHER"], 0, 1), "TRANS_EAT" => $arDef["TRANS_EAT"] === "N" ? "N" : "Y", "USE_GOOGLE" => $arDef["USE_GOOGLE"] === "Y" ? "Y" : "N"));
} else {
$arDef = "";
}
}
if (array_key_exists("SORT", $arFields)) {
$arFields["SORT"]["DEFAULT_VALUE"] = intval($arFields["SORT"]["DEFAULT_VALUE"]);
}
while ($ar = $res->Fetch()) {
if (array_key_exists($ar["FIELD_ID"], $arFields) && array_key_exists($ar["FIELD_ID"], $arDefFields)) {
if ($arDefFields[$ar["FIELD_ID"]]["IS_REQUIRED"] === false) {
$IS_REQUIRED = $arFields[$ar["FIELD_ID"]]["IS_REQUIRED"];
} else {
$IS_REQUIRED = $arDefFields[$ar["FIELD_ID"]]["IS_REQUIRED"];
}
$IS_REQUIRED = $IS_REQUIRED === "Y" ? "Y" : "N";
if ($ar["IS_REQUIRED"] !== $IS_REQUIRED || $ar["DEFAULT_VALUE"] !== $arFields[$ar["FIELD_ID"]]["DEFAULT_VALUE"]) {
$arUpdate = array("IS_REQUIRED" => $IS_REQUIRED, "DEFAULT_VALUE" => $arFields[$ar["FIELD_ID"]]["DEFAULT_VALUE"]);
} else {
$arUpdate = array();
}
unset($arDefFields[$ar["FIELD_ID"]]);
} elseif (array_key_exists($ar["FIELD_ID"], $arDefFields)) {
$IS_REQUIRED = $arDefFields[$ar["FIELD_ID"]]["IS_REQUIRED"];
$IS_REQUIRED = $IS_REQUIRED === "Y" ? "Y" : "N";
if ($ar["IS_REQUIRED"] !== $IS_REQUIRED) {
$arUpdate = array("IS_REQUIRED" => $IS_REQUIRED, "DEFAULT_VALUE" => "");
} else {
$arUpdate = array();
}
unset($arDefFields[$ar["FIELD_ID"]]);
} else {
$DB->Query("DELETE FROM b_iblock_fields WHERE IBLOCK_ID = " . $ID . " AND FIELD_ID = '" . $DB->ForSQL($ar["FIELD_ID"]) . "'");
$arUpdate = array();
}
$strUpdate = $DB->PrepareUpdate("b_iblock_fields", $arUpdate);
if ($strUpdate != "") {
$strSql = "UPDATE b_iblock_fields SET " . $strUpdate . " WHERE IBLOCK_ID = " . $ID . " AND FIELD_ID = '" . $ar["FIELD_ID"] . "'";
$arBinds = array("DEFAULT_VALUE" => $arUpdate["DEFAULT_VALUE"]);
$DB->QueryBind($strSql, $arBinds);
}
}
foreach ($arDefFields as $FIELD_ID => $arDefaults) {
if (array_key_exists($FIELD_ID, $arFields)) {
if ($arDefaults["IS_REQUIRED"] === false) {
$IS_REQUIRED = $arFields[$FIELD_ID]["IS_REQUIRED"];
} else {
$IS_REQUIRED = $arDefaults["IS_REQUIRED"];
}
$DEFAULT_VALUE = $arFields[$FIELD_ID]["DEFAULT_VALUE"];
} else {
$IS_REQUIRED = $arDefaults["IS_REQUIRED"];
$DEFAULT_VALUE = false;
}
$IS_REQUIRED = $IS_REQUIRED === "Y" ? "Y" : "N";
$arAdd = array("ID" => 1, "IBLOCK_ID" => $ID, "FIELD_ID" => $FIELD_ID, "IS_REQUIRED" => $IS_REQUIRED, "DEFAULT_VALUE" => $DEFAULT_VALUE);
$DB->Add("b_iblock_fields", $arAdd, array("DEFAULT_VALUE"));
}
CIBlock::CleanCache($ID);
}
}
示例4: disableIndexIblocks
protected function disableIndexIblocks()
{
if ($this->isStepFinished(__METHOD__)) {
return;
}
$this->connection->queryExecute("\n\t\t\tUPDATE b_iblock\n\t\t\t\tSET\n\t\t\t\t\tINDEX_ELEMENT = 'N',\n\t\t\t\t\tINDEX_SECTION = 'N'\n\t\t\tWHERE IBLOCK_TYPE_ID = 'library'\n\t\t");
$query = $this->connection->query("\n\t\t\tSELECT ID FROM b_iblock WHERE IBLOCK_TYPE_ID = 'library'\n\t\t");
while ($row = $query->fetch()) {
if (!empty($row['ID'])) {
CIBlock::CleanCache($row['ID']);
}
}
$this->setStepFinished(__METHOD__);
}