public function hookClearUserSmartyCache($params) { if (isset($params["userId"]) && !empty($params["userId"]) && is_numeric($params["userId"])) { $memcacheConfig = ConfigManager::getConfig('Db', 'Memcache')->AuxConfig; if (!empty($memcacheConfig) and $memcacheConfig->enabled == true) { $memcached = new MemcacheWrapper($memcacheConfig->host, $memcacheConfig->port); $memcached->invalidateCacheByTag("smrt:u" . $params["userId"]); } } }
protected function invalidateUserCacheByUserId($userId) { if (empty($userId) or !is_numeric($userId)) { throw new InvalidArgumentException("\$userId have to be non zero integer"); } if ($this->memcache != null) { $this->memcache->invalidateCacheByTag(self::USER_TAG . $userId); } $hookParams = array('userId' => $userId); HookManager::callHook("ClearUserCache", $hookParams); }