* cache class name
* @var string
*/
- public $cacheClass = 'wcf\system\cache\builder\CacheBuilderOption';
+ public $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder';
/**
* list of all option categories
* Gets the user options from cache.
*/
protected function readUserOptions() {
- // add cache resource
$cacheName = 'user-option-'.PACKAGE_ID;
- CacheHandler::getInstance()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', 'wcf\system\cache\builder\CacheBuilderOption');
-
- // get options
+ CacheHandler::getInstance()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\OptionCacheBuilder
+ ');
$this->options = CacheHandler::getInstance()->get($cacheName, 'options');
}
}
// load icon cache
- WCF::getCache()->addResource('icon-'.PACKAGE_ID.'-'.$this->styleID, WCF_DIR.'cache/cache.icon-'.PACKAGE_ID.'-'.$this->styleID.'.php', 'wcf\system\cache\builder\CacheBuilderIcon');
- $this->iconCache = WCF::getCache()->get('icon-'.PACKAGE_ID.'-'.$this->styleID);
+ $cacheName = 'icon-'.PACKAGE_ID.'-'.$this->styleID;
+ WCF::getCache()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\IconCacheBuilder'
+ );
+ $this->iconCache = WCF::getCache()->get($cacheName);
}
/**
*/
protected static function getUserOptionCache() {
$cacheName = 'user-option-'.PACKAGE_ID;
- CacheHandler::getInstance()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', 'wcf\system\cache\builder\CacheBuilderOption');
+ CacheHandler::getInstance()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\OptionCacheBuilder'
+ );
self::$userOptions = CacheHandler::getInstance()->get($cacheName, 'options');
}
* Loads the default cache resources.
*/
protected function loadDefaultCacheResources() {
- CacheHandler::getInstance()->addResource('languages', WCF_DIR.'cache/cache.languages.php', 'wcf\system\cache\builder\CacheBuilderLanguage');
- CacheHandler::getInstance()->addResource('spiders', WCF_DIR.'cache/cache.spiders.php', 'wcf\system\cache\builder\CacheBuilderSpider');
+ CacheHandler::getInstance()->addResource(
+ 'languages',
+ WCF_DIR.'cache/cache.languages.php',
+ 'wcf\system\cache\builder\LanguageCacheBuilder'
+ );
+ CacheHandler::getInstance()->addResource(
+ 'spiders',
+ WCF_DIR.'cache/cache.spiders.php',
+ 'wcf\system\cache\builder\SpiderCacheBuilder'
+ );
+
if (defined('PACKAGE_ID')) {
- CacheHandler::getInstance()->addResource('coreObjects-'.PACKAGE_ID, WCF_DIR.'cache/cache.coreObjects-'.PACKAGE_ID.'.php', 'wcf\system\cache\builder\CacheBuilderCoreObject');
+ CacheHandler::getInstance()->addResource(
+ 'coreObjects-'.PACKAGE_ID,
+ WCF_DIR.'cache/cache.coreObjects-'.PACKAGE_ID.'.php',
+ 'wcf\system\cache\builder\CoreObjectCacheBuilder'
+ );
}
}
*/
protected function loadDefaultCacheResources() {
parent::loadDefaultCacheResources();
- CacheHandler::getInstance()->addResource('packages', WCF_DIR.'cache/cache.packages.php', 'wcf\system\cache\builder\CacheBuilderPackage');
+
+ CacheHandler::getInstance()->addResource(
+ 'packages',
+ WCF_DIR.'cache/cache.packages.php',
+ 'wcf\system\cache\builder\PackageCacheBuilder'
+ );
}
/**
* Initializes cache.
*/
protected function init() {
+ $cacheName = 'application-'.PACKAGE_ID;
CacheHandler::getInstance()->addResource(
- 'application-'.PACKAGE_ID,
- WCF_DIR.'cache/cache.application-'.PACKAGE_ID.'.php',
- 'wcf\system\cache\builder\CacheBuilderApplication'
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\ApplicationCacheBuilder'
);
- $this->cache = CacheHandler::getInstance()->get('application-'.PACKAGE_ID);
+ $this->cache = CacheHandler::getInstance()->get($cacheName);
}
/**
* Loads cleanup adapter cache.
*/
protected function loadCache() {
+ $cacheName = 'cleanupAdapter-'.PACKAGE_ID;
CacheHandler::getInstance()->addResource(
- 'cleanupAdapter-'.PACKAGE_ID,
- WCF_DIR.'cache/cache.cleanupAdapter.php',
- 'wcf\system\cache\builder\CacheBuilderCleanupAdapter'
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\CleanupAdapterCacheBuilder'
);
- $this->cache = CacheHandler::getInstance()->get('cleanupAdapter-'.PACKAGE_ID);
+ $this->cache = CacheHandler::getInstance()->get($cacheName);
}
/**
*/
protected function loadCache() {
$cacheName = 'cronjobs-'.PACKAGE_ID;
- CacheHandler::getInstance()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', 'wcf\system\cache\builder\CacheBuilderCronjob');
+ CacheHandler::getInstance()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\CronjobCacheBuilder'
+ );
$this->cache = CacheHandler::getInstance()->get($cacheName);
}
* Loads all registered actions of the active package.
*/
protected function loadActions() {
- CacheHandler::getInstance()->addResource('eventListener-'.PACKAGE_ID, WCF_DIR.'cache/cache.eventListener-'.PACKAGE_ID.'.php', 'wcf\system\cache\builder\CacheBuilderEventListener');
- $cache = CacheHandler::getInstance()->get('eventListener-'.PACKAGE_ID);
- if (isset($cache['actions'])) $this->actions = $cache['actions'];
- if (isset($cache['inheritedActions'])) $this->inheritedActions = $cache['inheritedActions'];
+ $cacheName = 'eventListener-'.PACKAGE_ID;
+ CacheHandler::getInstance()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\EventListenerCacheBuilder'
+ );
+ $cache = CacheHandler::getInstance()->get($cacheName);
+
+ if (isset($cache['actions'])) {
+ $this->actions = $cache['actions'];
+ }
+ if (isset($cache['inheritedActions'])) {
+ $this->inheritedActions = $cache['inheritedActions'];
+ }
unset($cache);
- if (!is_array($this->actions)) $this->actions = array();
- if (!is_array($this->inheritedActions)) $this->inheritedActions = array();
+
+ if (!is_array($this->actions)) {
+ $this->actions = array();
+ }
+ if (!is_array($this->inheritedActions)) {
+ $this->inheritedActions = array();
+ }
}
/**
CacheHandler::getInstance()->addResource(
'languages',
WCF_DIR.'cache/cache.languages.php',
- 'wcf\system\cache\builder\CacheBuilderLanguage'
+ 'wcf\system\cache\builder\LanguageCacheBuilder'
);
self::$cache = CacheHandler::getInstance()->get('languages');
return;
}
- CacheHandler::getInstance()->addResource('menu-'.PACKAGE_ID, WCF_DIR.'cache/cache.menu-'.PACKAGE_ID.'.php', 'wcf\system\cache\builder\CacheBuilderACPMenu');
- $this->menuItems = CacheHandler::getInstance()->get('menu-'.PACKAGE_ID);
+ $cacheName = 'acpMenu-'.PACKAGE_ID;
+ CacheHandler::getInstance()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\ACPMenuCacheBuilder'
+ );
+ $this->menuItems = CacheHandler::getInstance()->get($cacheName);
}
}
parent::loadCache();
// get cache
- CacheHandler::getInstance()->addResource('pageMenu-'.PACKAGE_ID, WCF_DIR.'cache/cache.pageMenu-'.PACKAGE_ID.'.php', 'wcf\system\cache\builder\CacheBuilderPageMenu');
- $this->menuItems = CacheHandler::getInstance()->get('pageMenu-'.PACKAGE_ID);
+ $cacheName = 'pageMenu-'.PACKAGE_ID;
+ CacheHandler::getInstance()->addResource(
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\CacheBuilderPageMenu'
+ );
+ $this->menuItems = CacheHandler::getInstance()->get($cacheName);
}
/**
* Reads package dependency cache.
*/
protected static function readCache() {
+ $cacheName = 'packageDependencies-'.PACKAGE_ID;
CacheHandler::getInstance()->addResource(
- 'packageDependencies-'.PACKAGE_ID,
- WCF_DIR.'cache/cache.packageDependencies-'.PACKAGE_ID.'.php',
- 'wcf\system\cache\builder\CacheBuilderPackageDependency'
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\PackageDependencyCacheBuilder'
);
- self::$packageDependencyCache = CacheHandler::getInstance()->get('packageDependencies-'.PACKAGE_ID);
+ self::$packageDependencyCache = CacheHandler::getInstance()->get($cacheName);
}
}
$groupsFileName = StringUtil::getHash($groups);
// register cache resource
+ $cacheName = 'groups-'.PACKAGE_ID.'-'.$groups;
CacheHandler::getInstance()->addResource(
- 'groups-'.PACKAGE_ID.'-'.$groups,
- WCF_DIR.'cache/cache.groups-'.PACKAGE_ID.'-'.$groupsFileName.'.php',
- 'wcf\system\cache\builder\CacheBuilderUserGroupPermission'
+ $cacheName,
+ WCF_DIR.'cache/cache.'.$cacheName.'.php',
+ 'wcf\system\cache\builder\UserGroupPermissionCacheBuilder'
);
// get group data from cache
- $this->groupData = CacheHandler::getInstance()->get('groups-'.PACKAGE_ID.'-'.$groups);
+ $this->groupData = CacheHandler::getInstance()->get($cacheName);
if (isset($this->groupData['groupIDs']) && $this->groupData['groupIDs'] != $groups) {
$this->groupData = array();
}
*/
protected function init() {
// load cache
- CacheHandler::getInstance()->addResource('styles', WCF_DIR.'cache/cache.styles.php', 'wcf\system\cache\builder\CacheBuilderStyle');
+ CacheHandler::getInstance()->addResource(
+ 'styles',
+ WCF_DIR.'cache/cache.styles.php',
+ 'wcf\system\cache\builder\StyleCacheBuilder'
+ );
$this->cache = CacheHandler::getInstance()->get('styles');
}
* Loads cached template group information.
*/
protected function loadTemplateGroupCache() {
- CacheHandler::getInstance()->addResource('templateGroups', WCF_DIR.'cache/cache.templateGroups.php', 'wcf\system\cache\builder\CacheBuilderTemplateGroup');
+ CacheHandler::getInstance()->addResource(
+ 'templateGroups',
+ WCF_DIR.'cache/cache.templateGroups.php',
+ 'wcf\system\cache\builder\TemplateGroupCacheBuilder'
+ );
$this->templateGroupCache = CacheHandler::getInstance()->get('templateGroups');
}
CacheHandler::getInstance()->addResource(
$cacheName,
WCF_DIR.'cache/cache.'.$cacheName.'.php',
- 'wcf\system\cache\builder\CacheBuilderTemplateListener'
+ 'wcf\system\cache\builder\TemplateListenerCacheBuilder'
);
$this->templateListeners = CacheHandler::getInstance()->get($cacheName);
CacheHandler::getInstance()->addResource(
$cacheName,
WCF_DIR.'cache/templateListener/'.$cacheName.'.php',
- 'wcf\system\cache\builder\CacheBuilderTemplateListenerCode'
+ 'wcf\system\cache\builder\TemplateListenerCodeCacheBuilder'
);
$this->templateListeners[$templateName] = CacheHandler::getInstance()->get($cacheName);