From: Alexander Ebert Date: Tue, 28 May 2013 00:56:52 +0000 (+0200) Subject: Added support to alternate table prefix within PIPs X-Git-Tag: 2.0.0_Beta_1~30^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fbcb71711eb00c8bf5eb80f86948834ee2deecd7;p=GitHub%2FWoltLab%2FWCF.git Added support to alternate table prefix within PIPs Fixes #1195 --- diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php index 2dfefe5067..9fb4608012 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php @@ -15,6 +15,12 @@ use wcf\system\WCF; * @category Community Framework */ abstract class AbstractPackageInstallationPlugin implements IPackageInstallationPlugin { + /** + * table application prefix + * @var string + */ + public $application = 'wcf'; + /** * database table name * @var string @@ -73,7 +79,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation EventHandler::getInstance()->fireAction($this, 'hasUninstall'); $sql = "SELECT COUNT(*) AS count - FROM wcf".WCF_N."_".$this->tableName." + FROM ".$this->application.WCF_N."_".$this->tableName." WHERE packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->installation->getPackageID())); @@ -88,7 +94,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation // call 'uninstall' event EventHandler::getInstance()->fireAction($this, 'uninstall'); - $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName." + $sql = "DELETE FROM ".$this->application.WCF_N."_".$this->tableName." WHERE packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->installation->getPackageID()));