* Caches the acl categories for a certain package.
*
* @author Matthias Schmidt
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ACLOptionCategoryCacheBuilder implements ICacheBuilder {
+class ACLOptionCategoryCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$list = new ACLOptionCategoryList();
$list->readObjects();
* Caches the ACP menu items.
*
* @author Matthias Schmidt, Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ACPMenuCacheBuilder implements ICacheBuilder {
+class ACPMenuCacheBuilder extends AbstractCacheBuilder {
/**
* list of option categories which directly contain options
* @var array<string>
protected $categoryStructure = array();
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array();
// get "real" menu items
* Caches the ACP search providers.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ACPSearchProviderCacheBuilder implements ICacheBuilder {
+class ACPSearchProviderCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$providerList = new ACPSearchProviderList();
$providerList->sqlOrderBy = "acp_search_provider.showOrder ASC";
$providerList->readObjects();
* Caches applications.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ApplicationCacheBuilder implements ICacheBuilder {
+class ApplicationCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'abbreviation' => array(),
'application' => array(),
* Caches the acl options of categories.
*
* @author Matthias Schmidt
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class CategoryACLOptionCacheBuilder implements ICacheBuilder {
+class CategoryACLOptionCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array();
foreach (CategoryHandler::getInstance()->getCategories() as $objectTypeName => $categories) {
$objectType = CategoryHandler::getInstance()->getObjectTypeByName($objectTypeName);
* Caches the categories for the active application.
*
* @author Matthias Schmidt
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class CategoryCacheBuilder implements ICacheBuilder {
+class CategoryCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$list = new CategoryList();
$list->sqlSelects = "object_type.objectType";
$list->sqlJoins = "LEFT JOIN wcf".WCF_N."_object_type object_type ON (object_type.objectTypeID = category.objectTypeID)";
+++ /dev/null
-<?php
-namespace wcf\system\cache\builder;
-use wcf\system\WCF;
-
-/**
- * Caches cleanup adapters.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage system.cache.builder
- * @category Community Framework
- */
-class CleanupAdapterCacheBuilder implements ICacheBuilder {
- /**
- * @see wcf\system\cache\ICacheBuilder::getData()
- */
- public function getData(array $cacheResource) {
- $data = array(
- 'adapters' => array(),
- 'objectTypes' => array(),
- 'packageIDs' => array()
- );
-
- $sql = "SELECT listener.*, package.packageDir
- FROM wcf".WCF_N."_cleanup_listener listener
- LEFT JOIN wcf".WCF_N."_package package
- ON (package.packageID = listener.packageID)";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute();
- while ($row = $statement->fetchArray()) {
- if (!is_array($data['adapters'][$row['objectType']])) $data['adapters'][$row['objectType']] = array();
- $data['adapters'][$row['objectType']][] = $row;
-
- if (!is_array($data['objectTypes'][$row['objectType']])) $data['objectTypes'][$row['objectType']] = array();
- $data['objectTypes'][$row['objectType']][] = $row['packageID'];
- }
-
- $data['objectTypes'] = array_unique($data['objectTypes']);
- $data['packageIDs'] = array_unique($data['packageIDs']);
-
- return $data;
- }
-}
* Caches clipboard actions.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ClipboardActionCacheBuilder implements ICacheBuilder {
+class ClipboardActionCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$actionList = new ClipboardActionList();
$actionList->readObjects();
* Caches clipboard pages.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ClipboardPageCacheBuilder implements ICacheBuilder {
+class ClipboardPageCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$sql = "SELECT pageClassName, actionID
FROM wcf".WCF_N."_clipboard_page";
$statement = WCF::getDB()->prepareStatement($sql);
* Caches the core objects.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class CoreObjectCacheBuilder implements ICacheBuilder {
+class CoreObjectCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array();
$coreObjectList = new CoreObjectList();
* Caches cronjob information.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class CronjobCacheBuilder implements ICacheBuilder {
+class CronjobCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$sql = "SELECT MIN(nextExec) AS nextExec,
MIN(afterNextExec) AS afterNextExec
FROM wcf".WCF_N."_cronjob";
* Caches the event listeners.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class EventListenerCacheBuilder implements ICacheBuilder {
+class EventListenerCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'actions' => array('user' => array(), 'admin' => array()),
'inheritedActions' => array('user' => array(), 'admin' => array())
use wcf\system\WCF;
/**
- * Caches languages, language to packages relation, package to languages relation
- * and the id of the default language.
+ * Caches languages and the id of the default language.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class LanguageCacheBuilder implements ICacheBuilder {
+class LanguageCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'codes' => array(),
'countryCodes' => array(),
* Caches object types and object type definitions.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class ObjectTypeCacheBuilder implements ICacheBuilder {
+class ObjectTypeCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'categories' => array(),
'definitions' => array(),
use wcf\system\WCF;
/**
- * Caches the options and option categories
+ * Caches options and option categories
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class OptionCacheBuilder implements ICacheBuilder {
+class OptionCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * option class name
+ * @var string
*/
- public function getData(array $cacheResource) {
- $tableName = '';
- $type = $cacheResource['cache'];
-
- $regEx = new Regex('((?:^|[A-Z])[a-z]+)');
- $regEx->match($cacheResource['cache'], true);
- $matches = $regEx->getMatches();
- if (isset($matches[1])) {
- for ($i = 0, $length = count($matches[1]); $i < $length; $i++) {
- if (!empty($tableName)) {
- $tableName .= '_';
- }
-
- $tableName .= strtolower($matches[1][$i]);
- }
- }
-
+ protected $optionClassName = 'wcf\data\option\Option';
+
+ /**
+ * database table name
+ * @var string
+ */
+ protected $tableName = 'option';
+
+ /**
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
+ */
+ public function rebuild(array $parameters) {
$data = array(
'categories' => array(),
'options' => array(),
// option categories
// get all option categories and sort categories by priority
$sql = "SELECT categoryName, categoryID
- FROM wcf".WCF_N."_".$tableName."_category";
+ FROM wcf".WCF_N."_".$this->tableName."_category";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$optionCategories = array();
$conditions->add("categoryID IN (?)", array($optionCategories));
$sql = "SELECT option_category.*, package.packageDir
- FROM wcf".WCF_N."_".$tableName."_category option_category
+ FROM wcf".WCF_N."_".$this->tableName."_category option_category
LEFT JOIN wcf".WCF_N."_package package
ON (package.packageID = option_category.packageID)
".$conditions."
// get all options and sort options by priority
$optionIDs = array();
$sql = "SELECT optionName, optionID
- FROM wcf".WCF_N."_".$tableName;
+ FROM wcf".WCF_N."_".$this->tableName;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
}
if (!empty($optionIDs)) {
- // get option class from type
- $className = 'wcf\data\option\Option';
- if (!empty($type)) {
- // strip trailing underscore
- preg_match_all('~((?:^|[A-Z])[a-z]+)~', $type, $matches);
-
- if (isset($matches[1])) {
- $className = 'wcf\data\\';
- for ($i = 0, $length = count($matches[1]); $i < $length; $i++) {
- $className .= strtolower($matches[1][$i] . '\\');
- }
- $className .= ucfirst($type);
- }
- }
-
// get needed options
$conditions = new PreparedStatementConditionBuilder();
$conditions->add("optionID IN (?)", array($optionIDs));
$sql = "SELECT *
- FROM wcf".WCF_N."_".$tableName."
+ FROM wcf".WCF_N."_".$this->tableName."
".$conditions."
ORDER BY showOrder ASC";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
+ $optionClassName = $this->optionClassName;
while ($row = $statement->fetchArray()) {
- $data['options'][$row['optionName']] = new $className(null, $row);
+ $data['options'][$row['optionName']] = new $optionClassName(null, $row);
if (!isset($data['optionToCategories'][$row['categoryName']])) {
$data['optionToCategories'][$row['categoryName']] = array();
}
* Caches all installed packages.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class PackageCacheBuilder implements ICacheBuilder {
+class PackageCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'packages' => array(),
'packageIDs' => array()
* Caches the page menu items.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class PageMenuCacheBuilder implements ICacheBuilder {
+class PageMenuCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array();
$menuItemList = new PageMenuItemList();
* Caches sitemap structure.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class SitemapCacheBuilder implements ICacheBuilder {
+class SitemapCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$sitemapList = new SitemapList();
$sitemapList->sqlOrderBy = "sitemap.showOrder ASC";
$sitemapList->readObjects();
* Caches the list of search engine spiders.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class SpiderCacheBuilder implements ICacheBuilder {
+class SpiderCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$spiderList = new SpiderList();
$spiderList->sqlOrderBy = "spider.spiderID ASC";
$spiderList->readObjects();
* Caches the styles and style variables.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class StyleCacheBuilder implements ICacheBuilder {
+class StyleCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'default' => 0,
'styles' => array()
+++ /dev/null
-<?php
-namespace wcf\system\cache\builder;
-use wcf\system\WCF;
-
-/**
- * Caches the structure of templates.
- *
- * @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage system.cache.builder
- * @category Community Framework
- */
-class TemplateCacheBuilder implements ICacheBuilder {
- /**
- * @see wcf\system\cache\ICacheBuilder::getData()
- */
- public function getData(array $cacheResource) {
- $information = explode('-', $cacheResource['cache']);
- if (count($information) == 3) {
- $prefix = $information[0].'_';
- }
- else {
- $prefix = '';
- }
-
- $data = array();
-
- // get all templates and filter options with low priority
- $sql = "SELECT templateName, template.packageID
- FROM wcf".WCF_N."_".$prefix."template";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute();
- while ($row = $statement->fetchArray()) {
- if (!isset($data[$row['templateName']])) {
- $data[$row['templateName']] = $row['packageID'];
- }
- }
-
- return $data;
- }
-}
* Caches template groups.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class TemplateGroupCacheBuilder implements ICacheBuilder {
+class TemplateGroupCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$templateGroupList = new TemplateGroupList();
$templateGroupList->readObjects();
* Caches template listener information.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class TemplateListenerCacheBuilder implements ICacheBuilder {
+class TemplateListenerCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
- list(, $environment) = explode('-', $cacheResource['cache']);
-
+ public function rebuild(array $parameters) {
// get templates for current package id
$templateListenerList = new TemplateListenerList();
- $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($environment));
+ $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($parameters['environment']));
$templateListenerList->readObjects();
$data = array();
* Caches the template listener code for a certain template in a certain environment.
*
* @author Alexander Ebert
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class TemplateListenerCodeCacheBuilder implements ICacheBuilder {
+class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
- list($environment, $templateName) = explode('-', $cacheResource['cache']);
-
+ public function rebuild(array $parameters) {
// get template codes for specified template
$templateListenerList = new TemplateListenerList();
- $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($environment));
- $templateListenerList->getConditionBuilder()->add("template_listener.templateName = ?", array($templateName));
+ $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($parameters['environment']));
+ $templateListenerList->getConditionBuilder()->add("template_listener.templateName = ?", array($parameters['templateName']));
$templateListenerList->readObjects();
$data = array();
* Caches all user groups.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class UserGroupCacheBuilder implements ICacheBuilder {
+class UserGroupCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
$data = array(
'types' => array(),
'groups' => array()
--- /dev/null
+<?php
+namespace wcf\system\cache\builder;
+
+/**
+ * Caches user group options and categories
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2013 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.builder
+ * @category Community Framework
+ */
+class UserGroupOptionCacheBuilder extends OptionCacheBuilder {
+ /**
+ * @see wcf\system\cache\builder\OptionCacheBuilder::$optionClassName
+ */
+ protected $optionClassName = 'wcf\data\user\group\option\UserGroupOption';
+
+ /**
+ * @see wcf\system\cache\builder\OptionCacheBuilder::$tableName
+ */
+ protected $tableName = 'user_group_option';
+}
* Caches the merged user group options for a certain user group combination.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class UserGroupPermissionCacheBuilder implements ICacheBuilder {
+class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder {
/**
* list of used group option type objects
* @var array<wcf\system\option\group\IGroupOptionType>
protected $typeObjects = array();
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
- list(, $groupIDs) = explode('-', $cacheResource['cache']);
+ public function rebuild(array $parameters) {
$data = array();
// get all options
if (!empty($options)) {
// get needed options
$conditions = new PreparedStatementConditionBuilder();
- $conditions->add("option_value.groupID IN (?)", array(explode(',', $groupIDs)));
+ $conditions->add("option_value.groupID IN (?)", array($parameters));
$conditions->add("option_value.optionID IN (?)", array($options));
$sql = "SELECT option_table.optionName, option_table.optionType, option_value.optionValue
}
}
- $data['groupIDs'] = $groupIDs;
+ $data['groupIDs'] = $parameters;
return $data;
}
--- /dev/null
+<?php
+namespace wcf\system\cache\builder;
+
+/**
+ * Caches user options and categories
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2013 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.builder
+ * @category Community Framework
+ */
+class UserOptionCacheBuilder extends OptionCacheBuilder {
+ /**
+ * @see wcf\system\cache\builder\OptionCacheBuilder::$optionClassName
+ */
+ protected $optionClassName = 'wcf\data\user\option\UserOption';
+
+ /**
+ * @see wcf\system\cache\builder\OptionCacheBuilder::$tableName
+ */
+ protected $tableName = 'user_option';
+}
* Caches the versions for a certain package and object type.
*
* @author Jeffrey Reichardt
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
*/
-class VersionCacheBuilder implements ICacheBuilder {
+class VersionCacheBuilder extends AbstractCacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
*/
- public function getData(array $cacheResource) {
+ public function rebuild(array $parameters) {
// get object types
$objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.versionableObject');