Changeset View
Changeset View
Standalone View
Standalone View
core/units/admin/admin_events_handler.php
Show First 20 Lines • Show All 1213 Lines • ▼ Show 20 Line(s) | |||||
if ( defined('DBG_REQUEST_LOG') && DBG_REQUEST_LOG && $this->Application->LoggedIn() ) { | if ( defined('DBG_REQUEST_LOG') && DBG_REQUEST_LOG && $this->Application->LoggedIn() ) { | ||||
$log = $this->Application->log('HTTP_REQUEST')->addRequestData(); | $log = $this->Application->log('HTTP_REQUEST')->addRequestData(); | ||||
if ( !$log->write() ) { | if ( !$log->write() ) { | ||||
trigger_error('Unable to log Http Request due disabled "System Log"', E_USER_WARNING); | trigger_error('Unable to log Http Request due disabled "System Log"', E_USER_WARNING); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | |||||
* Populates URL unit cache | |||||
* | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function OnPopulateUrlUnitCacheScheduledTask(kEvent $event) | |||||
Lint: CodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCaps: Protected method name "AdminEventsHandler::OnPopulateUrlUnitCacheScheduledTask" is not in camel… | |||||
{ | |||||
$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) ) { | |||||
Not Done ReplyUse construct similar to one from \kUnitConfigReader::includeConfigFiles method (setting part) to use database cache, when memory cache isn't available. When memory cache is disabled, then cache of urls from non-default units (e.g. links and products) won't ever be removed. alex: Use construct similar to one from `\kUnitConfigReader::includeConfigFiles` method (setting… | |||||
$this->Application->setCache('cached_urls_unit_prefixes', array_keys($prefixes), 3600); | |||||
} | |||||
else { | |||||
$this->Application->setDBCache('cached_urls_unit_prefixes', serialize(array_keys($prefixes)), 3600); | |||||
} | |||||
} | |||||
} | } | ||||
Closing brace of a class must be followed by a single blank line; found 2 Lint: CodingStandard.Classes.ClassDeclaration.NewlinesAfterCloseBrace: Closing brace of a class must be followed by a single blank line; found 2 | |||||
class UnitConfigDecorator { | class UnitConfigDecorator { | ||||
var $parentPath = Array (); | var $parentPath = Array (); | ||||
/** | /** | ||||
* Decorates given array | * Decorates given array | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
Protected method name "AdminEventsHandler::OnPopulateUrlUnitCacheScheduledTask" is not in camel caps format