From 637b76a007395705aeada88f71fa48c9b992ed88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Wed, 27 May 2015 17:32:27 +0200 Subject: [PATCH] Add application support for OptionCacheBuilder Closes #1910 --- .../cache/builder/OptionCacheBuilder.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php index 3ed649eaac..3d8e1ad517 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php @@ -27,6 +27,12 @@ class OptionCacheBuilder extends AbstractCacheBuilder { */ protected $tableName = 'option'; + /** + * application + * @var string + */ + protected $application = 'wcf'; + /** * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild() */ @@ -41,7 +47,7 @@ class OptionCacheBuilder extends AbstractCacheBuilder { // option categories // get all option categories and sort categories by priority $sql = "SELECT categoryName, categoryID - FROM wcf".WCF_N."_".$this->tableName."_category"; + FROM ".$this->application.WCF_N."_".$this->tableName."_category"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(); $optionCategories = array(); @@ -55,7 +61,7 @@ class OptionCacheBuilder extends AbstractCacheBuilder { $conditions->add("categoryID IN (?)", array($optionCategories)); $sql = "SELECT option_category.*, package.packageDir - FROM wcf".WCF_N."_".$this->tableName."_category option_category + FROM ".$this->application.WCF_N."_".$this->tableName."_category option_category LEFT JOIN wcf".WCF_N."_package package ON (package.packageID = option_category.packageID) ".$conditions." @@ -76,7 +82,7 @@ class OptionCacheBuilder extends AbstractCacheBuilder { // get all options and sort options by priority $optionIDs = array(); $sql = "SELECT optionName, optionID - FROM wcf".WCF_N."_".$this->tableName; + FROM ".$this->application.WCF_N."_".$this->tableName; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(); while ($row = $statement->fetchArray()) { @@ -89,7 +95,7 @@ class OptionCacheBuilder extends AbstractCacheBuilder { $conditions->add("optionID IN (?)", array($optionIDs)); $sql = "SELECT * - FROM wcf".WCF_N."_".$this->tableName." + FROM ".$this->application.WCF_N."_".$this->tableName." ".$conditions." ORDER BY showOrder ASC"; $statement = WCF::getDB()->prepareStatement($sql); -- 2.20.1