From: Matthias Schmidt Date: Sat, 13 Aug 2011 06:19:52 +0000 (+0200) Subject: Renamed cache builders (II) X-Git-Tag: 2.0.0_Beta_1~1879^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=edf364c2ea833f1443eea6b27ca781fd49e824a6;p=GitHub%2FWoltLab%2FWCF.git Renamed cache builders (II) --- diff --git a/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php index ded1777342..dea4920e85 100755 --- a/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php @@ -39,7 +39,7 @@ abstract class AbstractOptionListForm extends AbstractForm { * cache class name * @var string */ - public $cacheClass = 'wcf\system\cache\builder\CacheBuilderOption'; + public $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder'; /** * list of all option categories diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index f275f474e8..8f9a76eb8b 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -270,11 +270,12 @@ class UserListPage extends SortablePage { * 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'); } diff --git a/wcfsetup/install/files/lib/data/style/ActiveStyle.class.php b/wcfsetup/install/files/lib/data/style/ActiveStyle.class.php index 534c86f2ad..15b82e630a 100644 --- a/wcfsetup/install/files/lib/data/style/ActiveStyle.class.php +++ b/wcfsetup/install/files/lib/data/style/ActiveStyle.class.php @@ -41,8 +41,13 @@ class ActiveStyle extends DatabaseObjectDecorator { } // 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); } /** diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index c2218ffe96..4a02102072 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -174,7 +174,11 @@ class User extends DatabaseObject { */ 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'); } diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index bdf91a8b3b..7e4f803a47 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -288,10 +288,23 @@ class WCF { * 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' + ); } } diff --git a/wcfsetup/install/files/lib/system/WCFACP.class.php b/wcfsetup/install/files/lib/system/WCFACP.class.php index d2f6cc762b..e561cfca5b 100644 --- a/wcfsetup/install/files/lib/system/WCFACP.class.php +++ b/wcfsetup/install/files/lib/system/WCFACP.class.php @@ -93,7 +93,12 @@ class WCFACP extends WCF { */ 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' + ); } /** diff --git a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php index 82c452aa89..df3f41c594 100644 --- a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php +++ b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php @@ -24,12 +24,13 @@ class ApplicationHandler extends SingletonFactory { * 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); } /** diff --git a/wcfsetup/install/files/lib/system/cleanup/CleanupHandler.class.php b/wcfsetup/install/files/lib/system/cleanup/CleanupHandler.class.php index 0d920bf39c..8d88ad3b5b 100644 --- a/wcfsetup/install/files/lib/system/cleanup/CleanupHandler.class.php +++ b/wcfsetup/install/files/lib/system/cleanup/CleanupHandler.class.php @@ -47,13 +47,14 @@ class CleanupHandler { * 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); } /** diff --git a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php index e06007e4c3..e17d925d2e 100644 --- a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php @@ -198,7 +198,11 @@ class CronjobScheduler extends SingletonFactory { */ 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); } diff --git a/wcfsetup/install/files/lib/system/event/EventHandler.class.php b/wcfsetup/install/files/lib/system/event/EventHandler.class.php index 4efb9d529a..4a645f26b3 100644 --- a/wcfsetup/install/files/lib/system/event/EventHandler.class.php +++ b/wcfsetup/install/files/lib/system/event/EventHandler.class.php @@ -55,13 +55,28 @@ class EventHandler extends SingletonFactory { * 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(); + } } /** diff --git a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php index d464e6ad28..de8672cbe3 100644 --- a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php +++ b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php @@ -211,7 +211,7 @@ abstract class LanguageFactory { 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'); diff --git a/wcfsetup/install/files/lib/system/menu/acp/ACPMenu.class.php b/wcfsetup/install/files/lib/system/menu/acp/ACPMenu.class.php index 583e003153..34eb9aa6ca 100644 --- a/wcfsetup/install/files/lib/system/menu/acp/ACPMenu.class.php +++ b/wcfsetup/install/files/lib/system/menu/acp/ACPMenu.class.php @@ -24,7 +24,12 @@ class ACPMenu extends TreeMenu { 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); } } diff --git a/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php b/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php index ba39bf142c..9142c946ba 100644 --- a/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php +++ b/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php @@ -23,8 +23,13 @@ class PageMenu extends TreeMenu { 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); } /** diff --git a/wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php b/wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php index 2c1dec1af7..3437bd60e1 100644 --- a/wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php @@ -69,12 +69,13 @@ abstract class PackageDependencyHandler { * 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); } } diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 5c3d9d9387..92feaead7d 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -436,14 +436,15 @@ class SessionHandler extends SingletonFactory { $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(); } diff --git a/wcfsetup/install/files/lib/system/style/StyleHandler.class.php b/wcfsetup/install/files/lib/system/style/StyleHandler.class.php index c87ea632af..c6178e17c3 100644 --- a/wcfsetup/install/files/lib/system/style/StyleHandler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleHandler.class.php @@ -34,7 +34,11 @@ class StyleHandler extends SingletonFactory { */ 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'); } diff --git a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php index 3f55efde4e..5b39cd6df1 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php @@ -624,7 +624,11 @@ class TemplateEngine extends SingletonFactory { * 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'); } @@ -701,7 +705,7 @@ class TemplateEngine extends SingletonFactory { 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); @@ -734,7 +738,7 @@ class TemplateEngine extends SingletonFactory { 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);