option.inc.php is now properly rewritten upon (un)installation
authorAlexander Ebert <ebert@woltlab.com>
Tue, 27 Sep 2011 19:25:26 +0000 (21:25 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 27 Sep 2011 19:25:26 +0000 (21:25 +0200)
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php

index eb01a41c584566d8da76547dd747fc2f412a101f..e8e549516ffe08e3992611c075b5b543fad1c8c8 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\system\package;
 use wcf\system\menu\acp\ACPMenu;
 use wcf\data\application\ApplicationEditor;
 use wcf\data\language\LanguageEditor;
+use wcf\data\option\OptionEditor;
 use wcf\data\package\installation\queue\PackageInstallationQueue;
 use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
 use wcf\data\package\Package;
@@ -116,7 +117,13 @@ class PackageInstallationDispatcher {
                $this->nodeBuilder->completeNode($node);
                
                // assign next node
-               $step->setNode($this->nodeBuilder->getNextNode($node));
+               $node = $this->nodeBuilder->getNextNode($node);
+               $step->setNode($node);
+               
+               // update options.inc.php if installation is completed
+               if ($node == '') {
+                       OptionEditor::resetCache();
+               }
                
                return $step;
        }
index c85efacfd48e50718b7688f969133b5425d577e0..adfcb5e06155ca4f38f968bd694abd0b890b9195 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\package;
 use wcf\system\menu\acp\ACPMenu;
+use wcf\data\option\OptionEditor;
 use wcf\data\package\Package;
 use wcf\data\package\PackageEditor;
 use wcf\data\package\installation\queue\PackageInstallationQueue;
@@ -61,9 +62,15 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
                
                // mark node as completed
                $this->nodeBuilder->completeNode($node);
+               $node = $this->nodeBuilder->getNextNode($node);
+               
+               // update options.inc.php if uninstallation is completed
+               if ($node == '') {
+                       OptionEditor::resetCache();
+               }
                
                // return next node
-               return $this->nodeBuilder->getNextNode($node);
+               return $node;
        }
        
        /**
index 481d74aac140948707a7cd3183786e3bdbfbcaa9..0702b3eb6d8f610a9eb25e95d9aeb45b8e2b32f3 100644 (file)
@@ -98,11 +98,4 @@ class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationP
                        $optionEditor->update($data);
                }
        }
-       
-       /**
-        * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
-        */
-       protected function cleanup() {
-               OptionEditor::resetCache();
-       }
 }