[BUGFIX] Extension Scanner finds files on Windows 63/53763/4
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Tue, 22 Aug 2017 06:53:55 +0000 (08:53 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 22 Aug 2017 19:38:19 +0000 (21:38 +0200)
The extension scanner now also works on windows, as
the paths have been fixed to contain only one type of
slashes.

Change-Id: I9859f28029931f19f06873145e1de572fbb8bdfa
Resolves: #82153
Releases: master
Reviewed-on: https://review.typo3.org/53763
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/install/Classes/Controller/Action/Ajax/ExtensionScannerFiles.php
typo3/sysext/install/Classes/Controller/Action/Ajax/ExtensionScannerMarkFullyScannedRestFiles.php
typo3/sysext/install/Classes/Controller/Action/Ajax/ExtensionScannerScanFile.php

index f6c5321..e460b02 100644 (file)
@@ -54,7 +54,7 @@ class ExtensionScannerFiles extends AbstractAjaxAction
         $relativeFileNames = [];
         foreach ($files as $file) {
             /** @var $file SplFileInfo */
-            $relativeFileNames[] = $file->getRelativePathname();
+            $relativeFileNames[] = GeneralUtility::fixWindowsFilePath($file->getRelativePathname());
         }
 
         $this->view->assignMultiple([
index 6d86966..be5f413 100644 (file)
@@ -57,7 +57,7 @@ class ExtensionScannerMarkFullyScannedRestFiles extends AbstractAjaxAction
             }
 
             // Build array of file (hashes) not affected by current scan, if they are tagged as "FullyScanned"
-            $parsedRestFile = array_pop($documentationFile->getListEntry(realpath($restFile->getPathname())));
+            $parsedRestFile = array_pop($documentationFile->getListEntry(strtr(realpath($restFile->getPathname()), '\\', '/')));
             if (!in_array($parsedRestFile['file_hash'], $foundRestFileHashes, true)
                 && in_array('FullyScanned', $parsedRestFile['tags'], true)
             ) {
index 09120f6..2f8f399 100644 (file)
@@ -201,7 +201,7 @@ class ExtensionScannerScanFile extends AbstractAjaxAction
                     $restFileLocation = $restFile->getPathname();
                     break;
                 }
-                $parsedRestFile = array_pop($documentationFile->getListEntry(realpath($restFileLocation)));
+                $parsedRestFile = array_pop($documentationFile->getListEntry(strtr(realpath($restFileLocation), '\\', '/')));
                 $version = GeneralUtility::trimExplode('/', $restFileLocation);
                 array_pop($version);
                 // something like "8.2" .. "8.7" .. "master"