本文整理汇总了PHP中erLhcoreClassModule::moduleCacheEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModule::moduleCacheEnabled方法的具体用法?PHP erLhcoreClassModule::moduleCacheEnabled怎么用?PHP erLhcoreClassModule::moduleCacheEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModule
的用法示例。
在下文中一共展示了erLhcoreClassModule::moduleCacheEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getModule
public static function getModule($module)
{
$cfg = erConfigClassLhConfig::getInstance();
self::$moduleCacheEnabled = $cfg->getSetting('site', 'modulecompile');
// Because each siteaccess can have different extension cache key has to have this
$siteAccess = erLhcoreClassSystem::instance()->SiteAccess;
if (self::$cacheInstance === null) {
self::$cacheInstance = CSCacheAPC::getMem();
}
if (self::$moduleCacheEnabled === true) {
if (($cacheModules = self::$cacheInstance->restore('moduleFunctionsCache_' . $module . '_' . $siteAccess . '_version_' . self::$cacheVersionSite)) !== false) {
return $cacheModules;
}
$cacheWriter = new erLhcoreClassCacheStorage('cache/cacheconfig/');
if (($cacheModules = $cacheWriter->restore('moduleFunctionsCache_' . $module . '_' . $siteAccess)) == false) {
$cacheModules = array();
}
if (count($cacheModules) > 0) {
self::$cacheInstance->store('moduleFunctionsCache_' . $module . '_' . $siteAccess . '_version_' . self::$cacheVersionSite, $cacheModules);
return $cacheModules;
}
}
$extensions = $cfg->getOverrideValue('site', 'extensions');
$ViewListCompiled = array();
// Is it core module
if (file_exists('modules/lh' . $module . '/module.php')) {
include 'modules/lh' . $module . '/module.php';
foreach ($ViewList as $view => $params) {
$ViewList[$view]['script_path'] = 'modules/lh' . $module . '/' . $view . '.php';
}
$ViewListCompiled = array_merge($ViewListCompiled, $ViewList);
}
// Is it extension module
foreach ($extensions as $extension) {
if (file_exists('extension/' . $extension . '/modules/lh' . $module . '/module.php')) {
include 'extension/' . $extension . '/modules/lh' . $module . '/module.php';
foreach ($ViewList as $view => $params) {
$ViewList[$view]['script_path'] = 'extension/' . $extension . '/modules/lh' . $module . '/' . $view . '.php';
}
$ViewListCompiled = array_merge($ViewListCompiled, $ViewList);
}
}
if (count($ViewListCompiled) > 0) {
if (self::$moduleCacheEnabled === true) {
$cacheWriter->store('moduleFunctionsCache_' . $module . '_' . $siteAccess, $ViewListCompiled);
self::$cacheInstance->store('moduleFunctionsCache_' . $module . '_' . $siteAccess . '_version_' . self::$cacheVersionSite, $ViewListCompiled);
}
return $ViewListCompiled;
}
// Module does not exists
return false;
}