Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/application.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
* Template names, that will be used instead of regular templates | * Template names, that will be used instead of regular templates | ||||
* | * | ||||
* @var Array | * @var Array | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public $ReplacementTemplates = Array (); | public $ReplacementTemplates = Array (); | ||||
/** | /** | ||||
* Mod-Rewrite listeners used during url building and parsing | * Registered routers, that are used during url building and parsing. | ||||
* | * | ||||
* @var Array | * @var array | ||||
* @access public | |||||
*/ | */ | ||||
public $RewriteListeners = Array (); | public $routers = array(); | ||||
/** | /** | ||||
* Reference to debugger | * Reference to debugger | ||||
* | * | ||||
* @var Debugger | * @var Debugger | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public $Debugger = null; | public $Debugger = null; | ||||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Line(s) | |||||
$this->cacheManager->InitCache(); | $this->cacheManager->InitCache(); | ||||
if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | ||||
$this->Debugger->appendTimestamp('Before UnitConfigReader'); | $this->Debugger->appendTimestamp('Before UnitConfigReader'); | ||||
} | } | ||||
// init config reader and all managers | // init config reader and all managers | ||||
$this->UnitConfigReader = $this->makeClass('kUnitConfigReader'); | $this->UnitConfigReader = $this->makeClass('kUnitConfigReader'); | ||||
$this->UnitConfigReader->scanModules(MODULES_PATH); // will also set RewriteListeners when existing cache is read | $this->UnitConfigReader->scanModules(MODULES_PATH); // Will also set routers. | ||||
$this->registerModuleConstants(); | $this->registerModuleConstants(); | ||||
if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | ||||
$this->Debugger->appendTimestamp('After UnitConfigReader'); | $this->Debugger->appendTimestamp('After UnitConfigReader'); | ||||
} | } | ||||
define('MOD_REWRITE', $this->ConfigValue('UseModRewrite') && !$this->isAdmin ? 1 : 0); | define('MOD_REWRITE', $this->ConfigValue('UseModRewrite') && !$this->isAdmin ? 1 : 0); | ||||
Show All 27 Lines | |||||
} | } | ||||
if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | ||||
$this->Debugger->appendTimestamp('Loaded cache and phrases'); | $this->Debugger->appendTimestamp('Loaded cache and phrases'); | ||||
} | } | ||||
$this->ValidateLogin(); // must be called before AfterConfigRead, because current user should be available there | $this->ValidateLogin(); // must be called before AfterConfigRead, because current user should be available there | ||||
$this->UnitConfigReader->AfterConfigRead(); // will set RewriteListeners when missing cache is built first time | $this->UnitConfigReader->AfterConfigRead(); | ||||
if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { | ||||
$this->Debugger->appendTimestamp('Processed AfterConfigRead'); | $this->Debugger->appendTimestamp('Processed AfterConfigRead'); | ||||
} | } | ||||
if ( $this->GetVar('m_cat_id') === false ) { | if ( $this->GetVar('m_cat_id') === false ) { | ||||
$this->SetVar('m_cat_id', 0); | $this->SetVar('m_cat_id', 0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2562 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
public function setFromCache(&$data) | public function setFromCache(&$data) | ||||
{ | { | ||||
$this->Factory->setFromCache($data); | $this->Factory->setFromCache($data); | ||||
$this->UnitConfigReader->setFromCache($data); | $this->UnitConfigReader->setFromCache($data); | ||||
$this->EventManager->setFromCache($data); | $this->EventManager->setFromCache($data); | ||||
$this->ReplacementTemplates = $data['Application.ReplacementTemplates']; | $this->ReplacementTemplates = $data['Application.ReplacementTemplates']; | ||||
$this->RewriteListeners = $data['Application.RewriteListeners']; | $this->routers = $data['Application.Routers']; | ||||
$this->ModuleInfo = $data['Application.ModuleInfo']; | $this->ModuleInfo = $data['Application.ModuleInfo']; | ||||
} | } | ||||
/** | /** | ||||
* Gets object data for caching | * Gets object data for caching | ||||
* The following caches should be reset based on admin interaction (adjusting config, enabling modules etc) | * The following caches should be reset based on admin interaction (adjusting config, enabling modules etc) | ||||
* | * | ||||
* @access public | * @access public | ||||
* @return Array | * @return Array | ||||
*/ | */ | ||||
public function getToCache() | public function getToCache() | ||||
{ | { | ||||
return array_merge( | return array_merge( | ||||
$this->Factory->getToCache(), | $this->Factory->getToCache(), | ||||
$this->UnitConfigReader->getToCache(), | $this->UnitConfigReader->getToCache(), | ||||
$this->EventManager->getToCache(), | $this->EventManager->getToCache(), | ||||
Array ( | Array ( | ||||
'Application.ReplacementTemplates' => $this->ReplacementTemplates, | 'Application.ReplacementTemplates' => $this->ReplacementTemplates, | ||||
'Application.RewriteListeners' => $this->RewriteListeners, | 'Application.Routers' => $this->routers, | ||||
'Application.ModuleInfo' => $this->ModuleInfo, | 'Application.ModuleInfo' => $this->ModuleInfo, | ||||
) | ) | ||||
); | ); | ||||
} | } | ||||
public function delayUnitProcessing($method, $params) | public function delayUnitProcessing($method, $params) | ||||
{ | { | ||||
$this->cacheManager->delayUnitProcessing($method, $params); | $this->cacheManager->delayUnitProcessing($method, $params); | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |