本文整理汇总了PHP中Help::getLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP Help::getLocale方法的具体用法?PHP Help::getLocale怎么用?PHP Help::getLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Help
的用法示例。
在下文中一共展示了Help::getLocale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function &_getCache($tocId)
{
$cache =& Registry::get('helpTocCache', true, null);
$locale = Help::getLocale();
if (!isset($cache[$locale][$tocId])) {
$help =& Help::getHelp();
$cacheManager =& CacheManager::getManager();
$cache[$locale][$tocId] = $cacheManager->getFileCache('help-toc-' . $help->getLocale(), $tocId, array($this, '_cacheMiss'));
// Check to see if the cache info is outdated.
$cacheTime = $cache[$locale][$tocId]->getCacheTime();
if ($cacheTime !== null && $cacheTime < filemtime($this->getFilename($tocId))) {
// The cached data is out of date.
$cache[$locale][$tocId]->flush();
}
}
return $cache[$locale][$tocId];
}
示例2: import
function &_getCache($topicId)
{
static $cache;
$locale = Help::getLocale();
if (!isset($cache[$locale][$topicId])) {
import('cache.CacheManager');
$help =& Help::getHelp();
$cacheManager =& CacheManager::getManager();
$cache[$locale][$topicId] = $cacheManager->getFileCache('help-topic-' . $locale, $topicId, array($this, '_cacheMiss'));
// Check to see if the cache info is outdated.
$cacheTime = $cache[$locale][$topicId]->getCacheTime();
if ($cacheTime !== null && $cacheTime < filemtime($this->getFilename($topicId))) {
// The cached data is out of date.
$cache[$locale][$topicId]->flush();
}
}
return $cache[$locale][$topicId];
}