[TASK] Move entry path existance check in SystemEnvironmentBuilder 86/59386/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 9 Jan 2019 13:41:30 +0000 (14:41 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 9 Jan 2019 14:32:41 +0000 (15:32 +0100)
As a preparation to further path related clean ups, the
file existance check of the determined scriptPath must
only be checked if PATH_thisScript is not defined. This
is an edge case that was triggered with my patch for
issue #87247 and fixes unit tests for extensions with
current testing-framework.
Note this is not the final state and more patches to
handle the path mess will follow later.

Resolves: #87378
Related: #87247
Releases: master
Change-Id: I8e3d8524a5d40fe66bdfdbda92a2f18540d9a0d8
Reviewed-on: https://review.typo3.org/59386
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php

index 8b73939..7061db0 100644 (file)
@@ -167,13 +167,12 @@ class SystemEnvironmentBuilder
             $scriptPath = $rootPath . $scriptName;
         }
 
-        if (!is_file($scriptPath)) {
-            static::exitWithMessage('Unable to determine path to entry script.');
-        }
-
         if (!defined('PATH_thisScript')) {
             // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0
             define('PATH_thisScript', $scriptPath);
+            if (!is_file($scriptPath)) {
+                static::exitWithMessage('Unable to determine path to entry script.');
+            }
         }
 
         // Absolute path of the document root of the instance with trailing slash