Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/managers/cache_manager.php
Show First 20 Lines • Show All 296 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* Empties factory and event manager cache (without storing changes) | * Empties factory and event manager cache (without storing changes) | ||||
*/ | */ | ||||
public function EmptyUnitCache() | public function EmptyUnitCache() | ||||
{ | { | ||||
// maybe discover keys automatically from corresponding classes | // maybe discover keys automatically from corresponding classes | ||||
$cache_keys = Array ( | $cache_keys = Array ( | ||||
'Factory.Files', 'Factory.realClasses', | 'Factory.Files', 'Factory.Namespaces', 'Factory.realClasses', | ||||
'ConfigReader.prefixFiles', 'ConfigCloner.clones', | 'ConfigReader.prefixFiles', 'ConfigCloner.clones', | ||||
'EventManager.beforeHooks', 'EventManager.afterHooks', 'EventManager.scheduledTasks', 'EventManager.buildEvents', | 'EventManager.beforeHooks', 'EventManager.afterHooks', 'EventManager.scheduledTasks', 'EventManager.buildEvents', | ||||
'Application.ReplacementTemplates', 'Application.RewriteListeners', 'Application.ModuleInfo', | 'Application.ReplacementTemplates', 'Application.RewriteListeners', 'Application.ModuleInfo', | ||||
'Application.ConfigHash', 'Application.ConfigCacheIds', | 'Application.ConfigHash', 'Application.ConfigCacheIds', | ||||
); | ); | ||||
$empty_cache = Array (); | $empty_cache = Array (); | ||||
foreach ($cache_keys as $cache_key) { | foreach ($cache_keys as $cache_key) { | ||||
$empty_cache[$cache_key] = Array (); | $empty_cache[$cache_key] = Array (); | ||||
} | } | ||||
$this->Application->setFromCache($empty_cache); | $this->Application->setFromCache($empty_cache); | ||||
$this->setFromCache($empty_cache); | $this->setFromCache($empty_cache); | ||||
// otherwise ModulesHelper indirectly used from includeConfigFiles won't work | // Otherwise kModulesHelper indirectly used from includeConfigFiles won't work. | ||||
$this->Application->RegisterDefaultClasses(); | $this->Application->RegisterDefaultClasses(); | ||||
} | } | ||||
/** | /** | ||||
* Updates data, that was parsed from unit configs this time | * Updates data, that was parsed from unit configs this time | ||||
* | * | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 514 Lines • ▼ Show 20 Line(s) | |||||
$this->setCache('filenames' . $serial_name, $category_data['NamedParentPath']); | $this->setCache('filenames' . $serial_name, $category_data['NamedParentPath']); | ||||
$this->setCache('category_designs' . $serial_name, ltrim($category_data['CachedTemplate'], '/')); | $this->setCache('category_designs' . $serial_name, ltrim($category_data['CachedTemplate'], '/')); | ||||
$this->setCache('category_tree' . $serial_name, $category_data['TreeLeft'] . ';' . $category_data['TreeRight']); | $this->setCache('category_tree' . $serial_name, $category_data['TreeLeft'] . ';' . $category_data['TreeRight']); | ||||
} | } | ||||
} | } | ||||
return $this->getCache($cache_key); | return $this->getCache($cache_key); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |