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


PHP CPHPCache::Clean方法代碼示例

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


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

示例1: loadConfig

 public function loadConfig()
 {
     //todo fix empty config caching
     $cache = new \CPHPCache();
     $cacheFile = $_SERVER['DOCUMENT_ROOT'] . "/bitrix/cache/" . $cache->GetPath(__CLASS__);
     // проверяем, обновлялся ли конфиг
     $cacheWritten = filemtime($cacheFile);
     $configWritten = filemtime($this->configFile);
     // устаревший кеш или неудачно начатый кеш перезаписываем
     if ($configWritten > $cacheWritten || !$cache->InitCache(self::TTL, __CLASS__, '/')) {
         $cache->Clean(__CLASS__, '/');
         try {
             parent::loadConfig();
             if ($cache->StartDataCache(self::TTL, __CLASS__, '/')) {
                 $cache->EndDataCache(array('config' => $this->config));
             } else {
                 _log('Caching failed', 'widgets');
             }
         } catch (Exception $e) {
             _log('loading config error: ' . $e->getMessage(), 'widgets');
         }
     } else {
         $vars = $cache->GetVars();
         $this->config = $vars['config'];
     }
 }
開發者ID:ASDAFF,項目名稱:bx-structure,代碼行數:26,代碼來源:BStructure.php

示例2:

		function __blogcleartagsimportant($options, $cache_id, $cache_path)
		{
			$obCache = new CPHPCache;
			if ($cache_id != "")
				$obCache->Clean($cache_id, $cache_path);
			else
				$obCache->CleanDir($cache_path);
		}
開發者ID:ASDAFF,項目名稱:bitrix-5,代碼行數:8,代碼來源:user_blog_post_important.php

示例3: set

 /**
  * @param $name
  * @param $value
  * @param int $time
  */
 public function set($name, $value, $time = 3600)
 {
     $cache = new \CPHPCache();
     list($dir, $name) = $this->dirAndName($name);
     $cache->InitCache($time, $name, $dir);
     $cache->Clean($name, $dir);
     $cache->StartDataCache();
     $cache->EndDataCache(array('value' => $value));
 }
開發者ID:techart,項目名稱:bitrix.tao,代碼行數:14,代碼來源:cache.php

示例4: Clean

 public static function Clean($uniq_str, $initdir = false, $basedir = "cache")
 {
     if (is_object($this) && $this instanceof CPHPCache) {
         return $this->cache->clean($uniq_str, $initdir, $basedir);
     } else {
         $obCache = new CPHPCache();
         return $obCache->Clean($uniq_str, $initdir, $basedir);
     }
 }
開發者ID:andy-profi,項目名稱:bxApiDocs,代碼行數:9,代碼來源:cache.php

示例5: Set

 function Set($user_id, $type)
 {
     global $DB;
     $user_id = intval($user_id);
     if ($user_id <= 0) {
         return false;
     }
     if ($type != "Y") {
         $type = "N";
     }
     $strSQL = "\n\t\t\tINSERT INTO b_sonet_log_smartfilter (USER_ID, TYPE)\n\t\t\tVALUES (" . $user_id . ", '" . $type . "')\n\t\t\tON DUPLICATE KEY UPDATE TYPE = '" . $type . "'\n\t\t";
     $res = $DB->Query($strSQL, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
     if ($res) {
         CPHPCache::Clean('sonet_smartfilter_default_' . $user_id, '/sonet/log_smartfilter/');
     }
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:16,代碼來源:log_smartfilter.php

示例6: Add

 static function Add($arFields)
 {
     global $DB;
     if (!self::CheckFields('ADD', $arFields)) {
         return false;
     }
     $arInsert = $DB->PrepareInsert("b_socialservices_user", $arFields);
     $strSql = "INSERT INTO b_socialservices_user (" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $res = $DB->Query($strSql, true, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if (!$res) {
         $_SESSION["LAST_ERROR"] = GetMessage("SC_ADD_ERROR");
         return false;
     }
     $lastId = intval($DB->LastID());
     $cache_id = 'socserv_ar_user';
     $obCache = new CPHPCache();
     $cache_dir = '/bx/socserv_ar_user';
     $obCache->Clean($cache_id, $cache_dir);
     $events = GetModuleEvents("socialservices", "OnAfterSocServUserAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array(&$arFields));
     }
     return $lastId;
 }
開發者ID:nProfessor,項目名稱:Mytb,代碼行數:24,代碼來源:authmanager.php

示例7: CanAccessFiles

 static function CanAccessFiles($iblock_id, $entity_type, $entity_id)
 {
     $result = false;
     $iblock_id = intval($iblock_id);
     $entity_id = intval($entity_id);
     if ($iblock_id > 0 && $entity_id > 0 && ($entity_type == 'group' || $entity_type == 'user')) {
         //cache
         $value = false;
         static $data = array();
         $CACHE_PATH = "/" . SITE_ID . "/webdav/can_access_files";
         $CACHE_ID = $iblock_id;
         $CACHE_TIME = 3600 * 24 * 30;
         $docCache = new CPHPCache();
         if (!isset($data[$iblock_id])) {
             if ($docCache->InitCache($CACHE_TIME, $CACHE_ID, $CACHE_PATH)) {
                 $value = $docCache->GetVars();
             }
             $data[$iblock_id] = $value;
         }
         if (isset($data[$iblock_id][$entity_type][$entity_id])) {
             return $data[$iblock_id][$entity_type][$entity_id];
         }
         //end cache
         CModule::IncludeModule('iblock');
         $rIB = CIBlock::GetList(array(), array('ID' => $iblock_id, "CHECK_PERMISSIONS" => "N"));
         if ($rIB && ($arIB = $rIB->Fetch()) && $arIB["RIGHTS_MODE"] === "E") {
             $rootSectionID = self::GetSectionID($iblock_id, $entity_type, $entity_id);
             if ($rootSectionID !== false) {
                 $ibRights = new CIBlockSectionRights($iblock_id, $rootSectionID);
                 $result = $ibRights->UserHasRightTo($iblock_id, $rootSectionID, 'section_read');
                 if (!$result) {
                     $arParams = array("DOCUMENT_TYPE" => array("webdav", "CIBlockDocumentWebdavSocnet", implode("_", array("iblock", $iblock_id, $entity_type, $entity_id))), "ROOT_SECTION_ID" => $rootSectionID, "ATTRIBUTES" => $entity_type == "user" ? array('user_id' => $entity_id) : array('group_id' => $entity_id));
                     $ob = new CWebDavIblock($iblock_id, '', $arParams);
                     if ($ob && empty($ob->arError) && $ob->permission > 'D') {
                         $files = array();
                         $options = array("path" => '/', "depth" => 1);
                         $res = $ob->PROPFIND($options, $files, array("return" => "array"));
                         $result = is_array($res) && sizeof($res['RESULT']) > 0;
                         // at least 1 item can be read
                     }
                 }
             } else {
                 return true;
             }
         } else {
             $result = CIBlock::GetPermission($iblock_id) > "D";
         }
         // cache
         if ($data[$iblock_id] === false) {
             $data[$iblock_id] = array();
         }
         $data[$iblock_id][$entity_type][$entity_id] = $result;
         $docCache->Clean($CACHE_ID, $CACHE_PATH);
         $docCache->InitCache($CACHE_TIME, $CACHE_ID, $CACHE_PATH);
         if ($docCache->StartDataCache()) {
             global $CACHE_MANAGER;
             $CACHE_MANAGER->StartTagCache($CACHE_PATH);
             $CACHE_MANAGER->RegisterTag("iblock_id_" . $iblock_id);
             $CACHE_MANAGER->RegisterTag('wd_socnet');
             $CACHE_MANAGER->EndTagCache();
             $docCache->EndDataCache($data[$iblock_id]);
         }
         // end cache
     }
     return $result;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:66,代碼來源:iblocksocnet.php

示例8: Add

 static function Add($arFields)
 {
     global $DB;
     if (!self::CheckFields('ADD', $arFields)) {
         return false;
     }
     $arInsert = $DB->PrepareInsert("b_socialservices_message", $arFields);
     $strSql = "INSERT INTO b_socialservices_message (" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $res = $DB->Query($strSql, true, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if (!$res) {
         return false;
     }
     $lastId = intval($DB->LastID());
     $cache_id = 'socserv_mes_user';
     $obCache = new CPHPCache();
     $cache_dir = '/bx/socserv_mes_user';
     $obCache->Clean($cache_id, $cache_dir);
     return $lastId;
 }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:19,代碼來源:authmanager.php

示例9: Delete

 static function Delete($id)
 {
     global $DB;
     $id = intval($id);
     if ($id > 0) {
         $rsUser = $DB->Query("SELECT ID FROM b_socialservices_message WHERE ID=" . $id);
         $arUser = $rsUser->Fetch();
         if (!$arUser) {
             return false;
         }
         /*	$db_events = GetModuleEvents("socialservices", "OnBeforeSocServUserDelete");
         			while($arEvent = $db_events->Fetch())
         				ExecuteModuleEventEx($arEvent, array($id));*/
         $DB->Query("DELETE FROM b_socialservices_message WHERE ID = " . $id . " ", true);
         $cache_id = 'socserv_mes_user';
         $obCache = new CPHPCache();
         $cache_dir = '/bx/socserv_mes_user';
         $obCache->Clean($cache_id, $cache_dir);
         return true;
     }
     return false;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:22,代碼來源:authmanager.php

示例10: Save

 function Save()
 {
     if (defined("BITRIX_SKIP_STACK_CACHE") && BITRIX_SKIP_STACK_CACHE) {
         return;
     }
     global $DB;
     if (!$this->cleanSet || !$this->cleanGet && count($this->values) >= $this->len) {
         $objCache = new CPHPCache();
         $objCache->Clean($this->entity, $DB->type . "/" . $this->entity, "stack_cache");
         if ($objCache->StartDataCache($this->ttl, $this->entity, $DB->type . "/" . $this->entity, $this->values, "stack_cache")) {
             $objCache->EndDataCache();
         }
         $this->cleanGet = true;
         $this->cleanSet = true;
     }
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:16,代碼來源:cache.php

示例11: CleanChatCache

 static function CleanChatCache($userId)
 {
     $bColorEnabled = IM\Color::isEnabled();
     $cache_id = 'im_chats_v4_' . $userId . '_' . $bColorEnabled;
     $obCLCache = new CPHPCache();
     $cache_dir = '/bx/imc/chats';
     $obCLCache->Clean($cache_id, $cache_dir);
 }
開發者ID:andy-profi,項目名稱:bxApiDocs,代碼行數:8,代碼來源:im_contact_list.php

示例12: foreach

             return $arIBlockSection;
         }
     }
     return false;
 }
 foreach ($arResult["CATEGORIES"] as $category_id => $arCategory) {
     foreach ($arCategory["ITEMS"] as &$arItem) {
         $pathResizeImage = NULL;
         $image = NULL;
         $arElement = NULL;
         $section = NULL;
         $arIBlockSection = NULL;
         if (CModule::IncludeModule("iblock")) {
             $cache_id = 'ajax-search-w' . $arItem['ITEM_ID'];
             if ($_REQUEST["clear_cache"] == "Y") {
                 CPHPCache::Clean($cache_id, "/");
             }
             if ($obCache->InitCache($arParams["CACHE_TIME"], $cache_id, "/")) {
                 $vars = $obCache->GetVars();
                 $pathResizeImage = $vars["PRODUCT_PICTURE_SRC"];
                 $section = $vars["SECTION"];
             } else {
                 if ($arItem['ITEM_ID'][0] == "S") {
                     $section = array();
                     $section_id = intval(substr($arItem['ITEM_ID'], 1));
                     $arIBlockSection = GetIBlockSection2($section_id);
                     $image = CFile::GetFileArray($arIBlockSection["PICTURE"]);
                     $image = $image["SRC"];
                     if (!$image) {
                         $section["NOT_IMAGE"] = true;
                     }
開發者ID:akniyev,項目名稱:itprom_dobrohost,代碼行數:31,代碼來源:result_modifier.php

示例13: Delete

	static function Delete($id)
	{
		global $DB;
		$id = intval($id);
		if ($id > 0)
		{
			$rsUser = $DB->Query("SELECT ID FROM b_socialservices_message WHERE ID=".$id);
			$arUser = $rsUser->Fetch();
			if(!$arUser)
				return false;

			$DB->Query("DELETE FROM b_socialservices_message WHERE ID = ".$id." ", true);
			$cache_id = 'socserv_mes_user';
			$obCache = new CPHPCache;
			$cache_dir = '/bx/socserv_mes_user';
			$obCache->Clean($cache_id, $cache_dir);
			return true;
		}
		return false;
	}
開發者ID:ASDAFF,項目名稱:bitrix-5,代碼行數:20,代碼來源:authmanager.php

示例14: CleanChatCache

 static function CleanChatCache($userId)
 {
     $cache_id = 'im_contact_list_chats_' . $userId . '_v1';
     $obCLCache = new CPHPCache();
     $cache_dir = '/bx/imc/chats';
     $obCLCache->Clean($cache_id, $cache_dir);
 }
開發者ID:vim84,項目名稱:b-markt,代碼行數:7,代碼來源:im_contact_list.php

示例15: GetMessage

	BXTIMEMAN.WND.SOCSERV_WND = new BX.SocservTimeman();
	BXTIMEMAN.WND.SOCSERV_WND.showWnd();
});
<?
		}
	}
	elseif($_REQUEST['action'] == "saveuserdata")
	{
		if(isset($_POST["ENABLED"]))
		{
			$userSocServSendEnable = $_POST["ENABLED"];
			CUserOptions::SetOption("socialservices","user_socserv_enable",$userSocServSendEnable, false, $userId);
			$cache_id = 'socserv_user_option_'.$userId;
			$obCache = new CPHPCache;
			$cache_dir = '/bx/socserv_user_option';
			$obCache->Clean($cache_id, $cache_dir);
		}
		else
		{
			$arUserSocServ = '';
			$userSocServSendEnable = $userSocServSendStart = $userSocServSendEnd = 'N';
			$userSocServEndText = GetMessage("JS_CORE_SS_WORKDAY_END");
			$userSocServStartText = GetMessage("JS_CORE_SS_WORKDAY_START");
			if(isset($_POST["SOCSERVARRAY"]) && !empty($_POST["SOCSERVARRAY"]))
				$arUserSocServ = serialize($_POST["SOCSERVARRAY"]);
			if(isset($_POST["STARTSEND"]))
				$userSocServSendStart = $_POST["STARTSEND"];
			if(isset($_POST["ENDSEND"]))
				$userSocServSendEnd = $_POST["ENDSEND"];
			if(isset($_POST["STARTTEXT"]))
				$userSocServStartText = $_POST["STARTTEXT"];
開發者ID:ASDAFF,項目名稱:bitrix-5,代碼行數:31,代碼來源:socserv.ajax.php


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