[TASK] Use TYPO3_OS constant in Services registration 53/53953/2
authorBenni Mack <benni@typo3.org>
Thu, 7 Sep 2017 14:25:20 +0000 (16:25 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 8 Sep 2017 21:37:55 +0000 (23:37 +0200)
There is a comment that TYPO3_OS is not yet defined, which
is wrong as it is one of the first things available during bootstrap,
so the check can be used directly.

Resolves: #82343
Releases: master, 8.7
Change-Id: I01e0aa7a090bc068195b44474f645d09220f8b71
Reviewed-on: https://review.typo3.org/53953
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index cddced5..c0f3b75 100644 (file)
@@ -1015,10 +1015,9 @@ class ExtensionManagementUtility
             // OS check
             // Empty $os means 'not limited to one OS', therefore a check is not needed
             if ($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['available'] && $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['os'] != '') {
-                // TYPO3_OS is not yet defined
-                $os_type = stripos(PHP_OS, 'win') !== false && !stripos(PHP_OS, 'darwin') !== false ? 'WIN' : 'UNIX';
+                $os_type = TYPO3_OS === 'WIN' ? 'WIN' : 'UNIX';
                 $os = GeneralUtility::trimExplode(',', strtoupper($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['os']));
-                if (!in_array($os_type, $os)) {
+                if (!in_array($os_type, $os, true)) {
                     self::deactivateService($serviceType, $serviceKey);
                 }
             }