当前位置: 首页>>代码示例>>PHP>>正文


PHP CPHPCache::CleanDir方法代码示例

本文整理汇总了PHP中CPHPCache::CleanDir方法的典型用法代码示例。如果您正苦于以下问题:PHP CPHPCache::CleanDir方法的具体用法?PHP CPHPCache::CleanDir怎么用?PHP CPHPCache::CleanDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPHPCache的用法示例。


在下文中一共展示了CPHPCache::CleanDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: SetRecent

 public static function SetRecent($entityId, $messageId, $isChat = false, $userId = false)
 {
     $entityId = intval($entityId);
     $messageId = intval($messageId);
     if ($entityId <= 0 || $messageId <= 0) {
         return false;
     }
     $userId = intval($userId);
     if ($userId <= 0) {
         $userId = $GLOBALS['USER']->GetID();
     }
     if (!$isChat && $userId == $entityId) {
         return false;
     }
     global $DB;
     $strSQL = "\n\t\t\tINSERT INTO b_im_recent (USER_ID, ITEM_TYPE, ITEM_ID, ITEM_MID)\n\t\t\tVALUES (" . $userId . ", '" . ($isChat ? IM_MESSAGE_GROUP : IM_MESSAGE_PRIVATE) . "', " . $entityId . ", " . $messageId . ")\n\t\t\tON DUPLICATE KEY UPDATE ITEM_MID = " . $messageId;
     $DB->Query($strSQL, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
     $obCache = new CPHPCache();
     $obCache->CleanDir('/bx/im/rec' . CIMMessenger::GetCachePath($userId));
     if ($isChat) {
         CIMMessenger::SpeedFileDelete($userId, IM_SPEED_GROUP);
     } else {
         CIMMessenger::SpeedFileDelete($userId, IM_SPEED_MESSAGE);
     }
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:26,代码来源:im_contact_list.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: SetRecent

 public static function SetRecent($arParams)
 {
     $itemId = intval($arParams['ENTITY_ID']);
     $messageId = intval($arParams['MESSAGE_ID']);
     if ($itemId <= 0) {
         return false;
     }
     $userId = intval($arParams['USER_ID']);
     if ($userId <= 0) {
         $userId = (int) $GLOBALS['USER']->GetID();
     }
     $chatType = IM_MESSAGE_PRIVATE;
     if (isset($arParams['CHAT_TYPE']) && in_array($arParams['CHAT_TYPE'], array(IM_MESSAGE_OPEN, IM_MESSAGE_CHAT))) {
         $chatType = $arParams['CHAT_TYPE'];
     } else {
         if (isset($arParams['CHAT_ID'])) {
             $orm = IM\ChatTable::getById($arParams['CHAT_ID']);
             if ($chatData = $orm->fetch()) {
                 $chatType = $chatData['TYPE'];
             }
         }
     }
     $isChat = in_array($chatType, array(IM_MESSAGE_OPEN, IM_MESSAGE_CHAT));
     if (!$isChat && $userId == $itemId) {
         return false;
     }
     global $DB;
     $strSQL = "\n\t\t\tINSERT INTO b_im_recent (USER_ID, ITEM_TYPE, ITEM_ID, ITEM_MID)\n\t\t\tVALUES (" . $userId . ", '" . $chatType . "', " . $itemId . ", " . $messageId . ")\n\t\t\tON DUPLICATE KEY UPDATE ITEM_MID = " . $messageId . "\n\t\t";
     $DB->Query($strSQL, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
     $obCache = new CPHPCache();
     $obCache->CleanDir('/bx/imc/recent' . CIMMessenger::GetCachePath($userId));
     if ($isChat) {
         CIMMessenger::SpeedFileDelete($userId, IM_SPEED_GROUP);
     } else {
         CIMMessenger::SpeedFileDelete($userId, IM_SPEED_MESSAGE);
     }
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:38,代码来源:im_contact_list.php

示例4: Add


//.........这里部分代码省略.........
				$arInsert[1] .= $value;
			}

			$ID = false;
			if (strlen($arInsert[0]) > 0)
			{
				$strSql =
					"INSERT INTO b_sonet_log_comment(".$arInsert[0].") ".
					"VALUES(".$arInsert[1].")";
				$DB->Query($strSql, False, "File: ".__FILE__."<br>Line: ".__LINE__);

				$ID = IntVal($DB->LastID());

				if ($ID > 0)
				{
					if (
						!array_key_exists("RATING_TYPE_ID", $arFields)
						|| empty($arFields["RATING_TYPE_ID"])
					)
						CSocNetLogComments::Update($ID, array(
							"RATING_TYPE_ID" => "LOG_COMMENT",
							"RATING_ENTITY_ID" => $ID
						));

					CSocNetLogFollow::Set(
						$arFields["USER_ID"], 
						"L".$arFields["LOG_ID"], 
						"Y", 
						ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL")
					);

					$rsLog = CSocNetLog::GetList(
						array(),
						array("ID" => $arFields["LOG_ID"]),
						false,
						false,
						array("ID", "USER_ID")
					);
					if (
						($arLog = $rsLog->Fetch())
						&& (intval($arLog["USER_ID"]) > 0)
					)
					{
						$default_follow = CSocNetLogFollow::GetDefaultValue($arLog["USER_ID"]);
						if ($default_follow != "Y")
						{
							$rsLogFollow = CSocNetLogFollow::GetList(
								array(
									"USER_ID" => $arLog["USER_ID"],
									"CODE" => "L".$arFields["LOG_ID"]
								), 
								array("TYPE")
							);

							$arLogFollow = $rsLogFollow->Fetch();
							if (!$arLogFollow)
								CSocNetLogFollow::Set($arLog["USER_ID"], "L".$arFields["LOG_ID"], "Y");
						}
					}

					if ($bSendEvent)
					{
						CSocNetLogComments::SendEvent($ID, "SONET_NEW_EVENT");
					}

					CSocNetLogComments::UpdateLogData($arFields["LOG_ID"], $bSetLogUpDate);

					$db_events = GetModuleEvents("socialnetwork", "OnAfterSocNetLogCommentAdd");
					while ($arEvent = $db_events->Fetch())
					{
						ExecuteModuleEventEx($arEvent, array($ID, $arFields));
					}

					$GLOBALS["USER_FIELD_MANAGER"]->Update("SONET_COMMENT", $ID, $arFields);

					if(defined("BX_COMP_MANAGED_CACHE"))
					{
						$GLOBALS["CACHE_MANAGER"]->ClearByTag("SONET_LOG_".$arFields["LOG_ID"]);
					}
					else
					{
						$cache = new CPHPCache;
						$cache->CleanDir("/sonet/log/".$arFields["LOG_ID"]."/comments/");
					}

					CSocNetLogComments::SendMentionNotification(array_merge($arFields, array("ID" => $ID)));
				}
			}

			CSocNetLogTools::SetCacheLastLogID("comment", $ID);
			return $ID;
		}
		elseif ($bSetSource && strlen($strMessage) > 0)
			return array(
				"ID" => false,
				"MESSAGE" => $strMessage
			);
		else
			return false;
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:101,代码来源:log_comments.php

示例5: Update

 function Update($ID, $arFields)
 {
     global $DB;
     if (!CSocNetGroup::__ValidateID($ID)) {
         return false;
     }
     $ID = IntVal($ID);
     $arFields1 = array();
     foreach ($arFields as $key => $value) {
         if (substr($key, 0, 1) == "=") {
             $arFields1[substr($key, 1)] = $value;
             unset($arFields[$key]);
         }
     }
     if (!CSocNetFeaturesPerms::CheckFields("UPDATE", $arFields, $ID)) {
         return false;
     }
     $db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetFeaturesPermsUpdate");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID, $arFields)) === false) {
             return false;
         }
     }
     $strUpdate = $DB->PrepareUpdate("b_sonet_features2perms", $arFields);
     foreach ($arFields1 as $key => $value) {
         if (strlen($strUpdate) > 0) {
             $strUpdate .= ", ";
         }
         $strUpdate .= $key . "=" . $value . " ";
     }
     if (strlen($strUpdate) > 0) {
         $strSql = "UPDATE b_sonet_features2perms SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
         $DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         $events = GetModuleEvents("socialnetwork", "OnSocNetFeaturesPermsUpdate");
         while ($arEvent = $events->Fetch()) {
             ExecuteModuleEventEx($arEvent, array($ID, $arFields));
         }
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_features2perms_" . $ID);
         } else {
             $dbGroupFeaturePerm = CSocNetFeaturesPerms::GetList(array(), array("ID" => $ID), false, false, array("FEATURE_ENTITY_TYPE", "FEATURE_ENTITY_ID"));
             if ($arGroupFeaturePerm = $dbGroupFeaturePerm->Fetch()) {
                 $cache = new CPHPCache();
                 $cache->CleanDir("/sonet/features_perms/" . $arGroupFeaturePerm["FEATURE_ENTITY_TYPE"] . "_" . $arGroupFeaturePerm["FEATURE_ENTITY_ID"] . "/");
             }
         }
     } else {
         $ID = False;
     }
     return $ID;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:51,代码来源:group_features_perms.php

示例6: UnInstallDB

	function UnInstallDB($arParams = array())
	{
		global $DB, $APPLICATION;
		CAgent::RemoveModuleAgents('calendar');
		$errors = null;
		if ((true == array_key_exists("savedata", $arParams)) && ($arParams["savedata"] != 'Y'))
		{
			$GLOBALS["USER_FIELD_MANAGER"]->OnEntityDelete("CALENDAR_EVENT");
			$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/'.$this->MODULE_ID.'/install/db/'.strtolower($DB->type).'/uninstall.sql');

			if (!empty($errors))
			{
				$APPLICATION->ThrowException(implode("", $errors));
				return false;
			}
			$this->UnInstallTasks();
		}

		UnRegisterModuleDependences("pull", "OnGetDependentModule", "calendar", "CCalendarPullSchema", "OnGetDependentModule");
		UnRegisterModuleDependences("im", "OnGetNotifySchema", "calendar", "CCalendarNotifySchema", "OnGetNotifySchema");
		UnRegisterModuleDependences("im", "OnBeforeConfirmNotify", "calendar", "CCalendar", "HandleImCallback");
		UnRegisterModuleDependences('intranet', 'OnPlannerInit', 'calendar', 'CCalendarEventHandlers', 'OnPlannerInit');
		UnRegisterModuleDependences('intranet', 'OnPlannerAction', 'calendar', 'CCalendarEventHandlers', 'OnPlannerAction');
		UnRegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'calendar', 'CCalendarRestService', 'OnRestServiceBuildDescription');
		UnRegisterModuleDependences('socialnetwork', 'OnFillSocNetFeaturesList', 'calendar', 'CCalendarLiveFeed', 'AddEvent');
		UnRegisterModuleDependences('socialnetwork', 'OnSonetLogEntryMenuCreate', 'calendar', 'CCalendarLiveFeed', 'OnSonetLogEntryMenuCreate');
		UnRegisterModuleDependences('socialnetwork', 'OnAfterSonetLogEntryAddComment', 'calendar', 'CCalendarLiveFeed', 'OnAfterSonetLogEntryAddComment');
		UnRegisterModuleDependences('socialnetwork', 'OnForumCommentIMNotify', 'calendar', 'CCalendarLiveFeed', 'OnForumCommentIMNotify');
		UnRegisterModuleDependences('socialnetwork', 'onAfterCommentAddAfter', 'calendar', 'CCalendarLiveFeed', 'onAfterCommentAddAfter');
		UnRegisterModuleDependences('socialnetwork', 'onAfterCommentUpdateAfter', 'calendar', 'CCalendarLiveFeed', 'onAfterCommentUpdateAfter');
		UnRegisterModuleDependences('search', 'BeforeIndex', 'calendar', 'CCalendarLiveFeed', 'FixForumCommentURL');

		UnRegisterModule("calendar");

		// Clear cache
		$arPath = array(
			'access_tasks',
			'type_list',
			'section_list',
			'attendees_list',
			'event_list'
		);
		$cache = new CPHPCache;
		foreach($arPath as $path)
			if ($path != '')
				$cache->CleanDir("calendar/".$path);

		// Remove tasks from LiveFeed
		if (
			IsModuleInstalled('socialnetwork')
			&& CModule::IncludeModule('socialnetwork')
		)
		{
			$dbRes = CSocNetLog::GetList(
				array(),
				array("EVENT_ID" => "calendar"),
				false,
				false,
				array("ID")
			);

			if ($dbRes)
			{
				while ($arRes = $dbRes->Fetch())
					CSocNetLog::Delete($arRes["ID"]);
			}
		}

		// Remove tasks from IM
		if (IsModuleInstalled('im') && CModule::IncludeModule('im'))
		{
			if (method_exists('CIMNotify', 'DeleteByModule'))
				CIMNotify::DeleteByModule('calendar');
		}

		return true;
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:77,代码来源:index.php

示例7: Delete

 public static function Delete($id)
 {
     $message = self::CheckPossibilityUpdateMessage($id);
     if (!$message) {
         return false;
     }
     $date = FormatDate("FULL", $message['DATE_CREATE'] + CTimeZone::GetOffset());
     IM\MessageTable::update($message['ID'], array("MESSAGE" => GetMessage('IM_MESSAGE_DELETED'), "MESSAGE_OUT" => GetMessage('IM_MESSAGE_DELETED_OUT', array('#DATE#' => $date))));
     CIMMessageParam::Set($message['ID'], array('IS_DELETED' => 'Y'));
     $arFields = $message;
     $arFields['MESSAGE'] = GetMessage('IM_MESSAGE_DELETED_OUT', array('#DATE#' => $date));
     $arFields['DATE_MODIFY'] = time() + CTimeZone::GetOffset();
     $relations = CIMMessenger::GetRelationById($message['ID']);
     $arPullMessage = array('id' => $arFields['ID'], 'type' => $arFields['MESSAGE_TYPE'] == IM_MESSAGE_PRIVATE ? 'private' : 'chat', 'date' => $arFields['DATE_MODIFY'], 'text' => GetMessage('IM_MESSAGE_DELETED'));
     if ($message['MESSAGE_TYPE'] == IM_MESSAGE_PRIVATE) {
         $arFields['FROM_USER_ID'] = $arFields['AUTHOR_ID'];
         foreach ($relations as $rel) {
             if ($rel['USER_ID'] != $arFields['AUTHOR_ID']) {
                 $arFields['TO_USER_ID'] = $rel['USER_ID'];
             }
         }
         $arPullMessage['fromUserId'] = $arFields['FROM_USER_ID'];
         $arPullMessage['toUserId'] = $arFields['TO_USER_ID'];
     } else {
         $arPullMessage['chatId'] = $arFields['CHAT_ID'];
         $arPullMessage['senderId'] = $arFields['AUTHOR_ID'];
     }
     foreach ($relations as $rel) {
         CPullStack::AddByUser($rel['USER_ID'], array('module_id' => 'im', 'command' => 'messageDelete', 'params' => $arPullMessage));
         $obCache = new CPHPCache();
         $obCache->CleanDir('/bx/imc/recent' . self::GetCachePath($rel['USER_ID']));
     }
     foreach (GetModuleEvents("im", "OnAfterMessagesDelete", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(intval($id), $arFields));
     }
     return true;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:37,代码来源:im_messenger.php

示例8: Delete

 function Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GL_WRONG_PARAMETER_ID"), "ERROR_NO_ID");
         return false;
     }
     $db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetLogDelete");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             return false;
         }
     }
     $DB->Query("DELETE LC FROM b_sonet_log_comment LC INNER JOIN (SELECT L.TMP_ID FROM b_sonet_log L WHERE L.ID = " . $ID . ") L1 ON LC.LOG_ID = L1.TMP_ID", true);
     $DB->Query("DELETE FROM b_sonet_log_right WHERE LOG_ID = " . $ID, true);
     $DB->Query("DELETE FROM b_sonet_log_site WHERE LOG_ID = " . $ID, true);
     $DB->Query("DELETE FROM b_sonet_log_favorites WHERE LOG_ID = " . $ID, true);
     $bSuccess = $DB->Query("DELETE FROM b_sonet_log WHERE ID = " . $ID, true);
     if ($bSuccess) {
         $GLOBALS["USER_FIELD_MANAGER"]->Delete("SONET_LOG", $ID);
         $db_events = GetModuleEvents("socialnetwork", "OnSocNetLogDelete");
         while ($arEvent = $db_events->Fetch()) {
             ExecuteModuleEventEx($arEvent, array($ID));
         }
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("SONET_LOG_" . $ID);
         }
         $cache = new CPHPCache();
         $cache->CleanDir("/sonet/log/" . intval($ID / 1000) . "/" . $ID . "/comments/");
     }
     return $bSuccess;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:33,代码来源:log.php

示例9: DeleteRecent

	public static function DeleteRecent($entityId, $isChat = false, $userId = false)
	{
		if (is_array($entityId))
		{
			foreach ($entityId as $key => $value)
				$entityId[$key] = intval($value);

			$sqlEntityId = 'ITEM_ID IN ('.implode(',', $entityId).')';
		}
		else if (intval($entityId) > 0)
		{
			$sqlEntityId = 'ITEM_ID = '.intval($entityId);
		}
		else
			return false;

		if (intval($userId) <= 0)
			$userId = $GLOBALS['USER']->GetID();

		global $DB;

		$strSQL = "DELETE FROM b_im_recent WHERE USER_ID = ".$userId." AND ITEM_TYPE = '".($isChat? IM_MESSAGE_GROUP: IM_MESSAGE_PRIVATE)."' AND ".$sqlEntityId;
		$DB->Query($strSQL, false, "FILE: ".__FILE__."<br> LINE: ".__LINE__);

		$obCache = new CPHPCache();
		$obCache->CleanDir('/bx/imc/rec'.CIMMessenger::GetCachePath($userId));

		return true;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:29,代码来源:im_contact_list.php

示例10: Delete

 public static function Delete($ID, $bSetSource = false)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GLC_WRONG_PARAMETER_ID"), "ERROR_NO_ID");
         return false;
     }
     $bSuccess = false;
     if ($arComment = CSocNetLogComments::GetByID($ID)) {
         if ($bSetSource) {
             if (strlen($arComment["EVENT_ID"]) > 0) {
                 $arCommentEvent = CSocNetLogTools::FindLogCommentEventByID($arComment["EVENT_ID"]);
                 if (!$arCommentEvent || !array_key_exists("DELETE_CALLBACK", $arCommentEvent) || !is_callable($arCommentEvent["DELETE_CALLBACK"])) {
                     $bSetSource = false;
                 }
             }
         }
         $bSuccess = true;
         if ($bSetSource) {
             $arSource = CSocNetLogComments::SetSource($arComment, "DELETE");
         }
         if (!$bSetSource || is_array($arSource) && (!isset($arSource["ERROR"]) || empty($arSource["ERROR"]))) {
             if ($bSuccess) {
                 $bSuccess = $DB->Query("DELETE FROM b_sonet_log_comment WHERE ID = " . $ID . "", true);
             }
             if ($bSuccess) {
                 $GLOBALS["USER_FIELD_MANAGER"]->Delete("SONET_COMMENT", $ID);
                 $db_events = GetModuleEvents("socialnetwork", "OnSocNetLogCommentDelete");
                 while ($arEvent = $db_events->Fetch()) {
                     ExecuteModuleEventEx($arEvent, array($ID));
                 }
                 if (intval($arComment["LOG_ID"]) > 0) {
                     CSocNetLogComments::UpdateLogData($arComment["LOG_ID"], false, true);
                     $cache = new CPHPCache();
                     $cache->CleanDir("/sonet/log/" . intval(intval($arComment["LOG_ID"]) / 1000) . "/" . $arComment["LOG_ID"] . "/comments/");
                 }
             }
         } elseif (is_array($arSource) && isset($arSource["ERROR"]) && is_string($arSource["ERROR"]) && !empty($arSource["ERROR"])) {
             $GLOBALS["APPLICATION"]->ThrowException($arSource["ERROR"], "ERROR_DELETE_SOURCE");
             $bSuccess = false;
         }
     }
     return $bSuccess;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:45,代码来源:log_comments.php

示例11: removeManifestById

 private static function removeManifestById($manifestId)
 {
     $cache = new \CPHPCache();
     $cachePath = self::getCachePath($manifestId);
     return $cache->CleanDir($cachePath);
 }
开发者ID:ASDAFF,项目名称:open_bx,代码行数:6,代码来源:appcachemanifest.php

示例12: clean

 public static function clean($cache_path)
 {
     global $CACHE_MANAGER;
     $obCache = new CPHPCache();
     $obCache->CleanDir($cache_path . "/");
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:6,代码来源:CCacheEx.php

示例13: afterUpdateTrigger

 /**
  * Method will be invoked after an database record updated.
  *
  * @param array $oldRecord All fields before update.
  * @param array $newRecord All fields after update.
  *
  * @return void
  */
 public function afterUpdateTrigger(array $oldRecord, array $newRecord)
 {
     if (!\Bitrix\Main\Loader::includeModule('pull')) {
         return;
     }
     $arFields = \CIMMessenger::GetById($newRecord['ID'], array('WITH_FILES' => 'Y'));
     if (!$arFields) {
         return;
     }
     $arFields['DATE_MODIFY'] = time() + \CTimeZone::GetOffset();
     $CCTP = new \CTextParser();
     $CCTP->MaxStringLen = 200;
     $CCTP->allow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "N", "TABLE" => "N", "CUT_ANCHOR" => "N", "ALIGN" => "N");
     $pullMessage = $CCTP->convertText(htmlspecialcharsbx($arFields['MESSAGE']));
     $relations = \CIMChat::GetRelationById($arFields['CHAT_ID']);
     $arPullMessage = array('id' => $arFields['ID'], 'type' => $arFields['MESSAGE_TYPE'] == IM_MESSAGE_PRIVATE ? 'private' : 'chat', 'text' => $pullMessage, 'date' => $arFields['DATE_MODIFY']);
     if ($arFields['MESSAGE_TYPE'] == IM_MESSAGE_PRIVATE) {
         $arFields['FROM_USER_ID'] = $arFields['AUTHOR_ID'];
         foreach ($relations as $rel) {
             if ($rel['USER_ID'] != $arFields['AUTHOR_ID']) {
                 $arFields['TO_USER_ID'] = $rel['USER_ID'];
             }
         }
         $arPullMessage['fromUserId'] = $arFields['FROM_USER_ID'];
         $arPullMessage['toUserId'] = $arFields['TO_USER_ID'];
     } else {
         $arPullMessage['chatId'] = $arFields['CHAT_ID'];
         $arPullMessage['senderId'] = $arFields['AUTHOR_ID'];
     }
     \CPullStack::AddByUsers(array_keys($relations), $p = array('module_id' => 'im', 'command' => $arFields['PARAMS']['IS_DELETED'] === 'Y' ? 'messageDelete' : 'messageUpdate', 'params' => $arPullMessage));
     foreach ($relations as $rel) {
         $obCache = new \CPHPCache();
         $obCache->CleanDir('/bx/imc/recent' . \CIMMessenger::GetCachePath($rel['USER_ID']));
     }
     if ($newRecord['MESSAGE_TYPE'] == IM_MESSAGE_OPEN) {
         \CPullWatch::AddToStack('IM_PUBLIC_' . $arFields['CHAT_ID'], array('module_id' => 'im', 'command' => $arFields['PARAMS']['IS_DELETED'] === 'Y' ? 'messageDelete' : 'messageUpdate', 'params' => $arPullMessage));
     }
     foreach (\GetModuleEvents("im", "OnAfterMessagesUpdate", true) as $arEvent) {
         \ExecuteModuleEventEx($arEvent, array(intval($newRecord['ID']), $arFields));
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:49,代码来源:messagehandler.php

示例14: UnInstallDB

	function UnInstallDB($arParams = array())
	{
		global $DB, $APPLICATION;
		CAgent::RemoveModuleAgents('calendar');
		$errors = null;
		if ((true == array_key_exists("savedata", $arParams)) && ($arParams["savedata"] != 'Y'))
		{
			$GLOBALS["USER_FIELD_MANAGER"]->OnEntityDelete("CALENDAR_EVENT");

			$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/'.$this->MODULE_ID.'/install/db/'.strtolower($DB->type).'/uninstall.sql');

			if (!empty($errors))
			{
				$APPLICATION->ThrowException(implode("", $errors));
				return false;
			}
			$this->UnInstallTasks();
		}

		UnRegisterModuleDependences("pull", "OnGetDependentModule", "calendar", "CCalendarPullSchema", "OnGetDependentModule");
		UnRegisterModuleDependences("im", "OnGetNotifySchema", "calendar", "CCalendarNotifySchema", "OnGetNotifySchema");
		UnRegisterModuleDependences("im", "OnBeforeConfirmNotify", "calendar", "CCalendar", "HandleImCallback");
		UnRegisterModuleDependences('intranet', 'OnPlannerInit', 'calendar', 'CCalendarEventHandlers', 'OnPlannerInit');
		UnRegisterModuleDependences('intranet', 'OnPlannerAction', 'calendar', 'CCalendarEventHandlers', 'OnPlannerAction');
		UnRegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'calendar', 'CCalendarRestService', 'OnRestServiceBuildDescription');
		UnRegisterModule("calendar");

		// Clear cache
		$arPath = array(
			'access_tasks',
			'type_list',
			'section_list',
			'attendees_list',
			'event_list'
		);
		$cache = new CPHPCache;
		foreach($arPath as $path)
			if ($path != '')
				$cache->CleanDir("calendar/".$path);

		return true;
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:42,代码来源:index.php

示例15: ClearCache

 function ClearCache()
 {
     global $CACHE_MANAGER;
     $cache = new CPHPCache();
     $cache->CleanDir("stickers/");
     $CACHE_MANAGER->CleanDir("fileman_stickers_count");
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:7,代码来源:sticker.php


注:本文中的CPHPCache::CleanDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。