From 0c4e061e3fbf56879c3ddf4d5af31c4a77c231a4 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 9 Sep 2012 12:00:23 +0200 Subject: [PATCH] Enhances package installation plugins Changes: * Adds `DatabaseObjectDecorator::getDatabaseTableAlias()` (needed later) * Removes obsolete `PageLocationPackageInstallationPlugin` * `AbstractXMLPackageInstallationPlugin::$tableName` is automatically set if it is empty and `AbstractXMLPackageInstallationPlugin::$className` is set. * `AbstractXMLPackageInstallationPlugin::$tagName ` is automatically set if it is empty and `AbstractXMLPackageInstallationPlugin::$tableName` is set/has been automatically set. * Updates/Adds some comments * Removes obsolete `ACPTemplatePackageInstallationPlugin::$tagName` * Fixes #769 --- .../data/DatabaseObjectDecorator.class.php | 7 ++ ...ACPMenuPackageInstallationPlugin.class.php | 12 +-- ...roviderPackageInstallationPlugin.class.php | 20 ----- ...emplatePackageInstallationPlugin.class.php | 7 +- ...ractXMLPackageInstallationPlugin.class.php | 38 ++++++++-- ...dActionPackageInstallationPlugin.class.php | 7 +- ...eObjectPackageInstallationPlugin.class.php | 22 +----- ...CronjobPackageInstallationPlugin.class.php | 12 +-- ...istenerPackageInstallationPlugin.class.php | 12 +-- ...initionPackageInstallationPlugin.class.php | 7 +- ...ectTypePackageInstallationPlugin.class.php | 11 +-- .../OptionPackageInstallationPlugin.class.php | 4 + .../PIPPackageInstallationPlugin.class.php | 7 +- ...ocationPackageInstallationPlugin.class.php | 76 ------------------- ...ageMenuPackageInstallationPlugin.class.php | 12 +-- ...SitemapPackageInstallationPlugin.class.php | 20 ----- ...tributePackageInstallationPlugin.class.php | 14 +--- .../StylePackageInstallationPlugin.class.php | 12 +-- ...istenerPackageInstallationPlugin.class.php | 21 +---- ...pOptionPackageInstallationPlugin.class.php | 4 + ...rOptionPackageInstallationPlugin.class.php | 8 +- 21 files changed, 71 insertions(+), 262 deletions(-) delete mode 100644 wcfsetup/install/files/lib/system/package/plugin/PageLocationPackageInstallationPlugin.class.php diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php index c767eae1ae..ea203f4a1b 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php @@ -71,6 +71,13 @@ abstract class DatabaseObjectDecorator extends DatabaseObject { return call_user_func_array(array($this->object, $name), $arguments); } + /** + * @see wcf\data\IStorableObject::getDatabaseTableAlias() + */ + public static function getDatabaseTableAlias() { + return call_user_func(array(static::$baseClass, 'getDatabaseTableAlias')); + } + /** * @see wcf\data\IStorableObject::getDatabaseTableName() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php index 9d51394838..ff25248010 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php @@ -5,7 +5,7 @@ namespace wcf\system\package\plugin; * This PIP installs, updates or deletes acp-menu items. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -16,14 +16,4 @@ class ACPMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationPl * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className */ public $className = 'wcf\data\acp\menu\item\ACPMenuItemEditor'; - - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'acp_menu_item'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'acpmenuitem'; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php index 5f5019befd..7ceef17b19 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php @@ -19,16 +19,6 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta */ public $className = 'wcf\data\acp\search\provider\ACPSearchProviderEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'acp_search_provider'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'acpsearchprovider'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() */ @@ -88,14 +78,4 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta protected function cleanup() { CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.acpSearchProvider-*.php'); } - - /** - * @see wcf\system\package\plugin\IPackageInstallationPlugin::uninstall() - */ - public function uninstall() { - parent::uninstall(); - - // clear cache immediately - CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.acpSearchProvider-*.php'); - } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php index e1431273e1..308efc71b9 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php @@ -9,7 +9,7 @@ use wcf\util\FileUtil; * This PIP installs, updates or deletes by a package delivered ACP templates. * * @author Benjamin Kunz - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -21,11 +21,6 @@ class ACPTemplatePackageInstallationPlugin extends AbstractPackageInstallationPl */ public $tableName = 'acp_template'; - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'acptemplate'; - /** * @see wcf\system\package\plugin\IPackageInstallationPlugin::install() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php index 9aa9ea382e..0427e3104d 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php @@ -2,6 +2,7 @@ namespace wcf\system\package\plugin; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\SystemException; +use wcf\system\package\PackageInstallationDispatcher; use wcf\system\WCF; use wcf\util\FileUtil; use wcf\util\XML; @@ -10,7 +11,7 @@ use wcf\util\XML; * Default implementation of some functions for a PackageInstallationPlugin using xml definitions. * * @author Marcel Werk - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -29,6 +30,23 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta */ public $tagName = ''; + /** + * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::install() + */ + public function __construct(PackageInstallationDispatcher $installation, $instruction = array()) { + parent::__construct($installation, $instruction); + + // autoset 'tableName' property + if (empty($this->tableName) && !empty($this->className)) { + $this->tableName = call_user_func(array($this->className, 'getDatabaseTableAlias')); + } + + // autoset 'tagName' property + if (empty($this->tagName) && !empty($this->tableName)) { + $this->tagName = str_replace('_', '', $this->tableName); + } + } + /** * @see wcf\system\package\plugin\IPackageInstallationPlugin::install() */ @@ -47,7 +65,17 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta // handle import $this->importItems($xpath); - // execute cleanup after successfull import/delete/update + // execute cleanup + $this->cleanup(); + } + + /** + * @see wcf\system\package\plugin\IPackageInstallationPlugin::uninstall() + */ + public function uninstall() { + parent::uninstall(); + + // execute cleanup $this->cleanup(); } @@ -193,7 +221,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta * * @param array $items */ - abstract protected function handleDelete(array $items); + protected abstract function handleDelete(array $items); /** * Prepares import, use this to map xml tags and attributes @@ -202,7 +230,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta * @param array $data * @return array */ - abstract protected function prepareImport(array $data); + protected abstract function prepareImport(array $data); /** * Validates given item, e.g. checking for invalid values. If validation @@ -218,7 +246,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta * @param array $data * @return array */ - abstract protected function findExistingItem(array $data); + protected abstract function findExistingItem(array $data); /** * Append additional fields which are not to be updated if a corresponding diff --git a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php index 5e8471996b..c514e8a954 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php @@ -6,7 +6,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes clipboard actions. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.package.plugin @@ -24,11 +24,6 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall */ protected $pages = array(); - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'clipboard_action'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php index 31446b4b6f..9cdbb9a30b 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php @@ -7,7 +7,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes core objects. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -19,16 +19,6 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation */ public $className = 'wcf\data\core\object\CoreObjectEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'core_object'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'coreobject'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() */ @@ -79,14 +69,4 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation protected function cleanup() { CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.coreObjects.php'); } - - /** - * @see wcf\system\package\plugin\IPackageInstallationPlugin::uninstall() - */ - public function uninstall() { - parent::uninstall(); - - // clear cache immediately - CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.coreObjects.php'); - } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php index 21b8817ed0..940e18bf52 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php @@ -7,7 +7,7 @@ use wcf\util\CronjobUtil; * This PIP installs, updates or deletes cronjobs. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.package.plugin @@ -19,16 +19,6 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu */ public $className = 'wcf\data\cronjob\CronjobEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'cronjob'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'cronjob'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php index ba6c77ae90..ab0834e008 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php @@ -7,7 +7,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes event listeners. * * @author Marcel Werk - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -19,16 +19,6 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat */ public $className = 'wcf\data\event\listener\EventListenerEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'event_listener'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'eventlistener'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php index d350ec3f9a..842ea38ae4 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php @@ -6,7 +6,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes object type definitions. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.package.plugin @@ -18,11 +18,6 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn */ public $className = 'wcf\data\object\type\definition\ObjectTypeDefinitionEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'object_type_definition'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index 358f976eaf..28e2093d83 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -7,7 +7,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes object types. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.package.plugin @@ -19,19 +19,14 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation */ public $className = 'wcf\data\object\type\ObjectTypeEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'object_type'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName */ public $tagName = 'type'; /** - * list of reserved tags - * @var array + * list of names of tags which aren't considered as additional data + * @var array */ public static $reservedTags = array('classname', 'definitionname', 'name'); diff --git a/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php index 80d3ab3d7f..2d82a0e488 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php @@ -22,6 +22,10 @@ class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationP */ public $tableName = 'option'; + /** + * list of names of tags which aren't considered as additional data + * @var array + */ public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'enableoptions', 'showorder', 'hidden', 'selectoptions', 'categoryname', 'permissions', 'options', 'attrs', 'cdata', 'supporti18n'); /** diff --git a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php index 6aaca229eb..e03d716ba0 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php @@ -6,7 +6,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes package installation plugins. * * @author Marcel Werk - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -18,11 +18,6 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin */ public $className = 'wcf\data\package\installation\plugin\PackageInstallationPluginEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'package_installation_plugin'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/PageLocationPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PageLocationPackageInstallationPlugin.class.php deleted file mode 100644 index 77e642b183..0000000000 --- a/wcfsetup/install/files/lib/system/package/plugin/PageLocationPackageInstallationPlugin.class.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @package com.woltlab.wcf.page - * @subpackage system.package.plugin - * @category Community Framework - */ -class PageLocationPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin { - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className - */ - public $className = 'wcf\data\page\location\PageLocationEditor'; - - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'page_location'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'pagelocation'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() - */ - protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName." - WHERE locationName = ? - AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - foreach ($items as $item) { - $statement->execute(array( - $item['attributes']['name'], - $this->installation->getPackageID() - )); - } - } - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport() - */ - protected function prepareImport(array $data) { - return array( - 'classPath' => (isset($data['elements']['classpath'])) ? $data['elements']['classpath'] : '', - 'locationName' => $data['attributes']['name'], - 'locationPattern' => $data['elements']['pattern'] - ); - } - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::findExistingItem() - */ - protected function findExistingItem(array $data) { - $sql = "SELECT * - FROM wcf".WCF_N."_".$this->tableName." - WHERE locationName = ? - AND packageID = ?"; - $parameters = array( - $data['locationName'], - $this->installation->getPackageID() - ); - - return array( - 'sql' => $sql, - 'parameters' => $parameters - ); - } -} diff --git a/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php index 5da42436f0..a8f3373fc4 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php @@ -5,7 +5,7 @@ namespace wcf\system\package\plugin; * This PIP installs, updates or deletes page page menu items. * * @author Marcel Werk - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -17,16 +17,6 @@ class PageMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationP */ public $className = 'wcf\data\page\menu\item\PageMenuItemEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'page_menu_item'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'pagemenuitem'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php index 8aefc912a3..33d4b6a088 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php @@ -19,16 +19,6 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu */ public $className = 'wcf\data\sitemap\SitemapEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'sitemap'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'sitemap'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() */ @@ -84,14 +74,4 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu protected function cleanup() { CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.sitemap-*.php'); } - - /** - * @see wcf\system\package\plugin\IPackageInstallationPlugin::uninstall() - */ - public function uninstall() { - parent::uninstall(); - - // clear cache immediately - CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.sitemap-*.php'); - } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/StyleAttributePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/StyleAttributePackageInstallationPlugin.class.php index ace898eb19..2bf3b6b554 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/StyleAttributePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/StyleAttributePackageInstallationPlugin.class.php @@ -119,23 +119,15 @@ class StyleAttributePackageInstallationPlugin extends AbstractXMLPackageInstalla } /** - * @see wcf\system\package\plugin\IPackageInstallationPlugin::uninstall() - */ - public function uninstall() { - parent::uninstall(); - - $this->cleanup(); - } - - /** - * Updates styles files of all styles. - */ + * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup() + */ protected function cleanup() { // get all styles $styleList = new StyleList(); $styleList->sqlLimit = 0; $styleList->readObjects(); + // update style files foreach ($styleList->getObjects() as $style) { $styleEditor = new StyleEditor($style); $styleEditor->writeStyleFile(); diff --git a/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php index bf9803bf12..367ace6575 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php @@ -8,7 +8,7 @@ use wcf\system\event\EventHandler; * This PIP installs, updates or deletes styles. * * @author Marcel Werk - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -20,16 +20,6 @@ class StylePackageInstallationPlugin extends AbstractPackageInstallationPlugin { */ public $className = 'wcf\data\style\StyleEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'style'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'style'; - /** * @see wcf\system\package\plugin\IPackageInstallationPlugin::install() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php index 65e41f1521..08aff76eb4 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php @@ -7,7 +7,7 @@ use wcf\system\WCF; * This PIP installs, updates or deletes template listeners. * * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -19,16 +19,6 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal */ public $className = 'wcf\data\template\listener\TemplateListenerEditor'; - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'template_listener'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'templatelistener'; - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete() */ @@ -89,15 +79,6 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal ); } - /** - * @see wcf\system\package\plugin\IPackageInstallationPlugin::uninstall() - */ - public function uninstall() { - parent::uninstall(); - - $this->cleanup(); - } - /** * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup() */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php index 9d8ecb2b28..1d92fa3589 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php @@ -23,6 +23,10 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst */ public $tableName = 'user_group_option'; + /** + * list of names of tags which aren't considered as additional data + * @var array + */ public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'admindefaultvalue', 'validationpattern', 'showorder', 'categoryname', 'selectoptions', 'enableoptions', 'permissions', 'options', 'attrs', 'cdata'); /** diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php index 9e12ca7f33..1f08b8acbf 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php @@ -12,7 +12,7 @@ use wcf\util\StringUtil; * This PIP installs, updates or deletes user fields. * * @author Benjamin Kunz - * @copyright 2001-2011 WoltLab GmbH + * @copyright 2001-2012 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.package.plugin @@ -23,7 +23,11 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName */ public $tableName = 'user_option'; - + + /** + * list of names of tags which aren't considered as additional data + * @var array + */ public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'disabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata'); /** -- 2.20.1