Enhances package installation plugins
authorMatthias Schmidt <gravatronics@live.com>
Sun, 9 Sep 2012 10:00:23 +0000 (12:00 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 9 Sep 2012 10:00:23 +0000 (12:00 +0200)
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

21 files changed:
wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/PageLocationPackageInstallationPlugin.class.php [deleted file]
wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/StyleAttributePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php

index c767eae1ae1100b60813b0aa14ada04c6374ab86..ea203f4a1bff42836c2af7e23488709524e7c261 100644 (file)
@@ -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()
         */
index 9d513948385862b1fc6fabff4d7c35b616e3905c..ff252480107111c3ab6a7e508b5bcf7e8b5728bd 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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';
 }
index 5f5019befda5f459f41626e6152702143949eb31..7ceef17b194ebc0e673aa4890f1cc65e572f0050 100644 (file)
@@ -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');
-       }
 }
index e1431273e15152d8ff0eef99769341c11044dacb..308efc71b972577509f2a123f44566d18fcbe680 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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()
         */
index 9aa9ea382e74d54807acd160c5da1757d5e0a74b..0427e3104da1e5cb03b309e6048cfc9a22506cf0 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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
index 5e8471996bcf932fcd947e39c4edc1e12041b6a1..c514e8a954fa28fae3502c9e9fe922c71745fba0 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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
         */     
index 31446b4b6f8cfbc40364066214958143b4f24247..9cdbb9a30bd8fe5ffe2c7924d10171054203a7ae 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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');
-       }
 }
index 21b8817ed079bed617aedc4f65c02e742751e745..940e18bf528541d47c3ebda0fe45523f18688632 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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()
         */
index ba6c77ae90b20ed5ebec12d3fc74e7f0dd177b93..ab0834e0085b138f5e618f73e01e05aebf0bdbf0 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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()
         */
index d350ec3f9a9d9fee9663303c372bef8be5aef5ff..842ea38ae4d0e5bbc31ec4b7153ed0de18393d2a 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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
         */     
index 358f976eaf3c145a24b87535dc8602d007660534..28e2093d831c9d685ce9890206d20329c2c54202 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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<string>
         */
        public static $reservedTags = array('classname', 'definitionname', 'name');
        
index 80d3ab3d7f4c3eddeae1cc894d44346231d09cf0..2d82a0e488a49713f09f474f4eb984247f4cc5e6 100644 (file)
@@ -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<string>
+        */
        public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'enableoptions', 'showorder', 'hidden', 'selectoptions', 'categoryname', 'permissions', 'options', 'attrs', 'cdata', 'supporti18n');
        
        /**
index 6aaca229eb9fb4980243b728b54c24ea6d6d19bc..e03d716ba0a6ff86064efeb29efc8daabb741708 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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 (file)
index 77e642b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-namespace wcf\system\package\plugin;
-use wcf\system\WCF;
-
-/**
- * This PIP installs, updates or deletes page locations.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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
-               );
-       }
-}
index 5da42436f00853917b31179c2bef51be6b8c4548..a8f3373fc4b7ff7c8bc0a93f07c9ff9f0fae89d5 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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()
         */
index 8aefc912a367b44c12724fa887d32a3661b9f74f..33d4b6a0884d819c6394e7e6c800ea1a415be776 100644 (file)
@@ -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');
-       }
 }
index ace898eb19e4c3794712269580864ce6b90e512e..2bf3b6b5545c65f928e4bfc50d6ffd14c49724f2 100644 (file)
@@ -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();
index bf9803bf1273e563c61b442935358ad78fdb670a..367ace6575ff88def6b596b9743e74af4d2678a0 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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()
         */
index 65e41f15217b0407f0c184eeb1d3bb66cb6c0618..08aff76eb4178218e0b952f15f6d12ba86677fbd 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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()
         */     
index 9d8ecb2b284a1c308d48d4fc8ad4e558f46e53cd..1d92fa35899478bf5d1b64a4a6f0a8cba8d2e086 100644 (file)
@@ -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<string>
+        */
        public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'admindefaultvalue', 'validationpattern', 'showorder', 'categoryname', 'selectoptions', 'enableoptions', 'permissions', 'options', 'attrs', 'cdata');
        
        /**
index 9e12ca7f33f63934c5d45dcc161072e716740ca7..1f08b8acbfd5dcc64bd8a18a0ad358c78a8ed0fb 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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<string>
+        */
        public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'disabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata');
        
        /**