static function getCachedComponentsMapping() { $sCacheFile = self::filenameCachedComponentsMapping(); if (!file_exists($sCacheFile)) { throw new AnwCacheNotFoundException(); } //mapping must be newer than override-global-settings if (filemtime($sCacheFile) < filemtime(AnwUtils::getFileOverride("global.cfg.php", AnwComponent::getGlobalComponentFullDir()))) { AnwDebug::log("cachedComponentsMapping obsoleted by settings"); throw new AnwCacheNotFoundException(); } //TODO: mapping should be expired by each modified available component? //load it from cache $oObject = (array) self::getCachedObject($sCacheFile); if (!is_array($oObject)) { AnwDebug::log("cachedComponentsMapping invalid : " . $sCacheFile); throw new AnwCacheNotFoundException(); } else { AnwDebug::log("cachedComponentsMapping found : " . $sCacheFile); } return $oObject; }
static function getCachedActionsMapping() { $sCacheFile = self::filenameCachedActionsMapping(); if (!file_exists($sCacheFile)) { throw new AnwCacheNotFoundException(); } //mapping must be newer than enabled-plugins-settings try { if (filemtime($sCacheFile) < filemtime(AnwUtils::getFileOverride("global.cfg.php", AnwComponent::getGlobalComponentFullDir()))) { self::debug("cachedActionsMapping obsoleted by settings"); throw new AnwCacheNotFoundException(); } } catch (AnwFileNotFoundException $e) { } //no override config //mapping must be newer than each available action $asEnabledActions = AnwComponent::getAvailableComponents(AnwComponent::TYPE_ACTION); foreach ($asEnabledActions as $sEnabledAction) { $asActionsFilesLocations = array(); $sActionFile = 'action_' . $sEnabledAction . '.php'; $sActionDir = AnwAction::getComponentDir($sEnabledAction); list($sFileActionDefault, $null) = AnwUtils::getFileDefault($sActionFile, $sActionDir); $asActionsFilesLocations[] = $sFileActionDefault; try { $sFileActionOverride = AnwUtils::getFileOverride($sActionDir, $sActionDir); $asActionsFilesLocations[] = $sFileActionOverride; } catch (AnwFileNotFoundException $e) { } //no override config foreach ($asActionsFilesLocations as $sActionFileLocation) { if (file_exists($sActionFileLocation) && filemtime($sCacheFile) < filemtime($sActionFileLocation)) { self::debug("cachedActionsMapping obsoleted by action : " . $sEnabledAction); throw new AnwCacheNotFoundException(); } } } //load it from cache $oObject = (array) self::getCachedObject($sCacheFile); if (!is_array($oObject)) { self::debug("cachedActionsMapping invalid : " . $sCacheFile); throw new AnwCacheNotFoundException(); } else { self::debug("cachedActionsMapping found : " . $sCacheFile); } return $oObject; }
loadApp(ANWPATH_CLASSES . "_drivers.php"); loadApp(ANWPATH_CLASSES . "class_acls.php"); loadApp(ANWPATH_CLASSES . "plugin/class_plugin.php"); loadApp(ANWPATH_CLASSES . "plugin/class_plugins.php"); loadApp(ANWPATH_CLASSES . "session/class_session.php"); loadApp(ANWPATH_CLASSES . "session/class_sessions.php"); loadApp(ANWPATH_CLASSES . "class_storage.php"); loadApp(ANWPATH_CLASSES . "user/class_user.php"); loadApp(ANWPATH_CLASSES . "user/class_users.php"); loadApp(ANWPATH_CLASSES . "class_action.php"); loadApp(ANWPATH_CLASSES . "class_page.php"); loadApp(ANWPATH_CLASSES . "class_pagegroup.php"); loadApp(ANWPATH_CLASSES . "class_naventry.php"); //require global template loadApp(ANWPATH_DEFAULT . AnwComponent::getGlobalComponentFullDir() . "global.tpl.php"); loadApp(ANWPATH_OVERRIDE . AnwComponent::getGlobalComponentFullDir() . "global.tpl.php"); //are we in minimal/batch/standard mode? if (ANWIKI_MODE_BATCH) { loadApp(ANWPATH_CLASSES . "session/class_currentsession-batch.php"); } else { if (ANWIKI_MODE_MINIMAL) { loadApp(ANWPATH_CLASSES . "session/class_currentsession-minimal.php"); } else { loadApp(ANWPATH_CLASSES . "session/class_currentsession.php"); } } AnwDebug::setTraceEnabled(AnwComponent::globalCfgTraceEnabled()); AnwEnv::init(); AnwDebug::stopBench("loading files"); /** * We use it for more flexibility.