Fix writability check during WCF updates
authorMatthias Schmidt <gravatronics@live.com>
Tue, 10 Sep 2019 16:08:06 +0000 (18:08 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 10 Sep 2019 16:08:06 +0000 (18:08 +0200)
wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php
wcfsetup/install/files/lib/system/cli/command/PackageCLICommand.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php

index b8e6f50e2b2d25c18420715a9bed39d6fc3f3409..260b55fd4fa6a508410314a37d4b6a709201e856 100755 (executable)
@@ -153,6 +153,10 @@ class InstallPackageAction extends AbstractDialogAction {
                // clean-up previously created nodes
                $this->installation->nodeBuilder->purgeNodes();
                
+               if ($this->installation->getAction() === 'update' && $this->queue->package === 'com.woltlab.wcf') {
+                       WCF::checkWritability();
+               }
+               
                // create node tree
                $this->installation->nodeBuilder->buildNodes();
                $nextNode = $this->installation->nodeBuilder->getNextNode();
index e5dafa1f4d8bfa1e97e3d67e0489ac9977ee3166..b705dfe4888181ad174adf7891f9c32b1d7d44f9 100644 (file)
@@ -313,6 +313,10 @@ class PackageCLICommand implements IArgumentedCLICommand {
                                        // clean-up previously created nodes
                                        $installation->nodeBuilder->purgeNodes();
                                        
+                                       if ($package !== null && $package->package === 'com.woltlab.wcf') {
+                                               WCF::checkWritability();
+                                       }
+                                       
                                        // create node tree
                                        $installation->nodeBuilder->buildNodes();
                                        $node = $installation->nodeBuilder->getNextNode();
index 551219baae6fa049658e2ee6acc14675f09577c9..54b55c163289c40b2ed15807ddb8c9f566650482 100644 (file)
@@ -396,10 +396,6 @@ class PackageInstallationDispatcher {
        protected function installPackage(array $nodeData) {
                $installationStep = new PackageInstallationStep();
                
-               if ($this->getAction() === 'update' && $this->getPackageName() === 'com.woltlab.wcf') {
-                       WCF::checkWritability();
-               }
-               
                // check requirements
                if (!empty($nodeData['requirements'])) {
                        foreach ($nodeData['requirements'] as $package => $requirementData) {
index b21a3d6522375a3fa95966df232e4a76ac0ccefc..8ba9dfb159f1e02fd0e27d299f6d7324ca621227 100644 (file)
@@ -509,6 +509,10 @@ class PackageInstallationNodeBuilder {
                                }
                        }
                        
+                       if ($archive->getPackageInfo('name') === 'com.woltlab.wcf') {
+                               WCF::checkWritability();
+                       }
+                       
                        // create new queue
                        $queue = PackageInstallationQueueEditor::create([
                                'parentQueueID' => $queue->queueID,