[BUGFIX] Remove symlink to typo3 folder in web dir 82/53682/2
authorHelmut Hummel <typo3@helhum.io>
Fri, 11 Aug 2017 14:31:22 +0000 (16:31 +0200)
committerHelmut Hummel <typo3@helhum.io>
Fri, 11 Aug 2017 14:43:01 +0000 (16:43 +0200)
When upgrading from older TYPO3 versions, composer installation
from that version created a symlink to the typo3 folder.

Before trying to remove typo3/sysext, we need to ensure
to remove a potentially existing symlink to typo3 folder
to not accidentally delete that sysext folder within
the sources directory.

Resolves: #82090
Releases: master
Change-Id: I12ef27d6236a9dbe844803afce55247a23ee5358
Reviewed-on: https://review.typo3.org/53682
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>

index 8bfc990..2c7a1dc 100644 (file)
@@ -88,6 +88,10 @@ class WebDirectory implements InstallerScript
         $webDir = $this->filesystem->normalizePath($this->pluginConfig->get('web-dir'));
         $backendDir = $webDir . self::$typo3Dir;
+        // Ensure we delete a previously existing symlink to typo3 folder in web directory
+        if ($this->filesystem->isSymlinkedDirectory($backendDir)) {
+            $this->filesystem->removeDirectory($backendDir);
+        }
         $localRepository = $this->composer->getRepositoryManager()->getLocalRepository();
         $package = $localRepository->findPackage('typo3/cms', new EmptyConstraint());