本文整理匯總了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;
}