[TASK] Deprecate GeneralUtility::getHostName 20/57820/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sun, 5 Aug 2018 12:46:58 +0000 (14:46 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 5 Aug 2018 21:41:34 +0000 (23:41 +0200)
Resolves: #85759
Releases: master
Change-Id: I95fd13114bd7390f1baaecf81f5ef5d6b5ee60a8
Reviewed-on: https://review.typo3.org/57820
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Łukasz Uznański <l.uznanski@macopedia.pl>
Tested-by: Łukasz Uznański <l.uznanski@macopedia.pl>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85759-DeprecateGeneralUtilitygetHostName.rst [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php

index 58aae01..1c6d1d3 100644 (file)
@@ -3038,9 +3038,11 @@ class GeneralUtility
      *
      * @param bool $requestHost Use request host (when not in CLI mode).
      * @return string The fully-qualified host name.
+     * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10
      */
     public static function getHostname($requestHost = true)
     {
+        trigger_error('The method `TYPO3\CMS\Core\Utility\GeneralUtility::getHostname()` has been deprecated and should not be used any longer, this method will be removed in TYPO3 v10.0', E_USER_DEPRECATED);
         $host = '';
         // If not called from the command-line, resolve on getIndpEnv()
         if ($requestHost && !Environment::isCli()) {
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85759-DeprecateGeneralUtilitygetHostName.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85759-DeprecateGeneralUtilitygetHostName.rst
new file mode 100644 (file)
index 0000000..bca6ee4
--- /dev/null
@@ -0,0 +1,32 @@
+.. include:: ../../Includes.txt
+
+===========================================================
+Deprecation: #85759 - Deprecate GeneralUtility::getHostName
+===========================================================
+
+See :issue:`85759`
+
+Description
+===========
+
+The method :php:`GeneralUtility::getHostName` has been marked as deprecated and will be removed in TYPO3 v10. The method is not in use anymore by the TYPO3 core.
+
+
+Impact
+======
+
+Calling the mentioned method will trigger a deprecation warning.
+
+
+Affected Installations
+======================
+
+Third party code which accesses the method.
+
+
+Migration
+=========
+
+No migration available.
+
+.. index:: PHP-API, FullyScanned
\ No newline at end of file
index 701053c..7d9c216 100644 (file)
@@ -610,4 +610,11 @@ return [
             'Deprecation-84414-BackendUtilityshortcutExists.rst',
         ],
     ],
+    'TYPO3\CMS\Core\Utility\GeneralUtility::getHostname' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-85759-DeprecateGeneralUtilitygetHostName.rst',
+        ],
+    ],
 ];