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


PHP CComponentEngine::makeComponentPath方法代码示例

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


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

示例1: getDataToCheck

 private static function getDataToCheck($messageId)
 {
     $return = false;
     if ($messageId > 0 && Loader::includeModule("forum")) {
         if (!array_key_exists($messageId, self::$messages)) {
             $cacheTtl = 2592000;
             $cacheId = 'forum_message_' . $messageId;
             $cachePath = \CComponentEngine::makeComponentPath("forum.topic.read");
             $cache = new \CPHPCache();
             $messages = $topics = array();
             if ($cache->initCache($cacheTtl, $cacheId, $cachePath)) {
                 list($messages, $topics) = $cache->getVars();
             } else {
                 $dbRes = \CForumMessage::getListEx(array("ID" => "ASC"), array("TOPIC" => "Y", "TOPIC_MESSAGE_ID" => $messageId, ">=ID" => $messageId), false, 10);
                 while ($res = $dbRes->fetch()) {
                     $messages["M" . $res["ID"]] = array_intersect_key($res, array("ID" => "", "TOPIC_ID" => "", "FORUM_ID" => "", "USER_ID" => "", "NEW_TOPIC" => "", "PARAM1" => "", "PARAM2" => ""));
                     if (!array_key_exists("T" . $res["TOPIC_ID"], $topics)) {
                         $topics["T" . $res["TOPIC_ID"]] = array("TITLE" => $res["TITLE"], "USER_ID" => $res["USER_START_ID"], "XML_ID" => $res["TOPIC_XML_ID"], "SOCNET_GROUP_ID" => $res["TOPIC_SOCNET_GROUP_ID"], "OWNER_ID" => $res["TOPIC_OWNER_ID"]);
                     }
                 }
                 if (!empty($messages)) {
                     $cache->startDataCache();
                     $res = reset($topics);
                     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
                     \CForumCacheManager::setTag($cachePath, "forum_topic_" . $res['ID']);
                     $cache->endDataCache(array($messages, $topics));
                 }
             }
             self::$messages += $messages;
             self::$topics += $topics;
         }
         if (array_key_exists("M" . $messageId, self::$messages)) {
             $return = array(self::$messages["M" . $messageId], self::$topics["T" . self::$messages["M" . $messageId]["TOPIC_ID"]], \CForumNew::getByIDEx(self::$messages["M" . $messageId]["FORUM_ID"], SITE_ID));
         }
     }
     return $return;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:37,代码来源:forummessageconnector.php


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