[TASK] Use TYPO3_OS constant in Services registration 45/54045/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 22:33:06 +0000 (00:33 +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/54045
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index e1c59c0..eace602 100644 (file)
@@ -1149,10 +1149,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);
                 }
             }