Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/admin/admin_events_handler.php
Show First 20 Lines • Show All 1228 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
protected function OnPurgeExpiredDatabaseCacheScheduledTask(kEvent $event) | protected function OnPurgeExpiredDatabaseCacheScheduledTask(kEvent $event) | ||||
{ | { | ||||
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'SystemCache | $sql = 'DELETE FROM ' . TABLE_PREFIX . 'SystemCache | ||||
WHERE LifeTime > 0 AND Cached + LifeTime < ' . time(); | WHERE LifeTime > 0 AND Cached + LifeTime < ' . time(); | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
/** | |||||
* Populates URL unit cache | |||||
* | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function OnPopulateUrlUnitCacheScheduledTask(kEvent $event) | |||||
{ | |||||
$sql = 'SELECT DISTINCT Prefixes | |||||
FROM ' . TABLE_PREFIX . 'CachedUrls'; | |||||
$urls = $this->Conn->GetColIterator($sql); | |||||
$prefixes = array(); | |||||
foreach ( $urls as $url_prefixes ) { | |||||
$url_prefixes = explode('|', trim($url_prefixes, '|')); | |||||
foreach ( $url_prefixes as $url_prefix ) { | |||||
$url_prefix = explode(':', $url_prefix); | |||||
$prefixes[$url_prefix[0]] = 1; | |||||
} | |||||
} | |||||
if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | |||||
$this->Application->setCache('cached_urls_unit_prefixes', array_keys($prefixes), 3600); | |||||
} | |||||
else { | |||||
$this->Application->setDBCache('cached_urls_unit_prefixes', serialize(array_keys($prefixes)), 3600); | |||||
} | |||||
} | |||||
} | } | ||||
class UnitConfigDecorator { | class UnitConfigDecorator { | ||||
var $parentPath = Array (); | var $parentPath = Array (); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |