[TASK] Deprecate TYPO3_OS constant 32/57632/2
authorBenni Mack <benni@typo3.org>
Thu, 19 Jul 2018 15:25:15 +0000 (17:25 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 19 Jul 2018 15:45:21 +0000 (17:45 +0200)
The TYPO3_OS constant is deprecated with
the introduction of Environment API.

Resolves: #85597
Releases: master
Change-Id: Ie0f844d2d024f2a3f6acdf5af24debead6ba836b
Reviewed-on: https://review.typo3.org/57632
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85285-DeprecatedSystemConstants.rst
typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ConstantMatcher.php

index e2a5a48..2ed868d 100644 (file)
@@ -381,7 +381,7 @@ class SystemEnvironmentBuilder
         }
         // Find out if path is relative or not
         $isRelativePath = false;
-        if (TYPO3_OS === 'WIN') {
+        if (self::getTypo3Os() === 'WIN') {
             if (!preg_match('/^([a-zA-Z]:)?\\\\/', $scriptPath)) {
                 $isRelativePath = true;
             }
index f45734c..969228c 100644 (file)
@@ -23,6 +23,9 @@ The following constants have been deprecated and should not be used any longer:
 * :php:`PATH_typo3conf`
   Use :php:`Environment::getPublicPath() . '/typo3conf'` instead
 
+* :php:`TYPO3_OS`
+  Use :php:`Environment::isWindows()` and :php:`Environment::isUnix()` instead
+
 
 Impact
 ======
@@ -48,4 +51,4 @@ Migration
 Usages of the above constants should be switched to the Environment class methods instead.
 
 
-.. index:: PHP-API, FullyScanned
\ No newline at end of file
+.. index:: PHP-API, FullyScanned
index 1f65b42..404fdda 100644 (file)
@@ -618,7 +618,7 @@ class ResourceCompressorTest extends BaseTestCase
             Environment::getVarPath(),
             Environment::getConfigPath(),
             PATH_site . 'index.php',
-            TYPO3_OS === 'WIN' ? 'WINDOWS' : 'UNIX'
+            Environment::isWindows() ? 'WINDOWS' : 'UNIX'
         );
         $_SERVER['ORIG_SCRIPT_NAME'] = '/index.php';
         $this->subject = $this->getAccessibleMock(ResourceCompressor::class, ['dummy']);
index c16ac74..ec4f4a4 100644 (file)
@@ -83,4 +83,10 @@ return [
             'Deprecation-85285-DeprecatedSystemConstants.rst',
         ],
     ],
+    'TYPO3_OS' => [
+        'restFiles' => [
+            'Feature-84153-IntroduceAGenericEnvironmentClass.rst',
+            'Deprecation-85285-DeprecatedSystemConstants.rst',
+        ],
+    ],
 ];