[!!!][TASK] Use native trigger_error and ErrorHandler for deprecations 15/54015/30
authorBenni Mack <benni@typo3.org>
Fri, 8 Sep 2017 12:14:44 +0000 (14:14 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 4 Oct 2017 18:02:14 +0000 (20:02 +0200)
The native PHP way of triggering deprecations by a framework or
applications is done via
`trigger_error($deprecationMessage, E_USER_DEPRECATED)`.

Previously, TYPO3 used `GeneralUtility::deprecationLog()` and
similar methods to generate a custom deprecation log, however it's
more flexible to use native logging through TYPO3's ErrorHandler.

This solution centralizes the way to configure the place if and
how deprecation logs should be written to various log destinations.

This also changes the way how deprecated methods, arguments and classes
are handled.

The new way to deprecate code in TYPO3 is done via
`trigger_error()`, the @deprecated annotation within a method only
exists now for IDE support, but is not reflected anymore for the
logging message.
That's why the @deprecated annotation does not contain
a description anymore.

The methods
GeneralUtility::logDeprecatedFunction()
GeneralUtility::deprecationLog()
GeneralUtility::getDeprecationLogFileName()
GeneralUtility::logDeprecatedViewHelperAttribute()

are marked as deprecated from now on.

The configuration option $TYPO3_CONF_VARS[SYS][enableDeprecationLog]
is removed.

Deprecation messages can now be activated by adding
the E_USER_DEPRECATED constant to the respective values in

$TYPO3_CONF_VARS[SYS][errorHandlerErrors]
 (so exceptions are handled by the TYPO3 error handler)
$TYPO3_CONF_VARS[SYS][syslogErrorReporting]
 (so exceptions are put into GeneralUtility::sysLog)
$TYPO3_CONF_VARS[SYS][belogErrorReporting]
 (so exceptions are put into sys_log DB table)
$TYPO3_CONF_VARS[SYS][exceptionalErrors]
 (so exceptions are thrown on a deprecation)

Deprecations will still go into GeneralUtility::devLog(),
if deprecations are activated via the "errorHandlerErrors" option.

Tests which test explicitly for deprecated code is moved into
Tests/UnitDeprecated, to ensure that the deprecated code is not
throwing an exception.

Resolves: #82438
Releases: master
Change-Id: I6ef9a642d179001f0484c4c7678e0bec12284faf
Reviewed-on: https://review.typo3.org/54015
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
41 files changed:
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlexPrepare.php
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php
typo3/sysext/backend/Tests/UnitDeprecated/Form/FormDataProvider/TcaFlexPrepareTest.php [new file with mode: 0644]
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Error/ErrorHandler.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/core/Classes/Package/Package.php
typo3/sysext/core/Classes/Resource/Utility/BackendUtility.php
typo3/sysext/core/Classes/Service/AbstractService.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
typo3/sysext/core/Documentation/Changelog/master/Deprecation-82438-DeprecationMethods.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/AbstractViewHelperTest.php
typo3/sysext/fluid/Tests/UnitDeprecated/Core/ViewHelper/AbstractViewHelperTest.php [new file with mode: 0644]
typo3/sysext/frontend/Classes/ContentObject/ScalableVectorGraphicsContentObject.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/Utility/EidUtility.php
typo3/sysext/install/Classes/Configuration/Context/CustomPreset.php
typo3/sysext/install/Classes/Configuration/Context/DebugPreset.php
typo3/sysext/install/Classes/Configuration/Context/LivePreset.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
typo3/sysext/lang/Classes/Command/LanguageUpdateCommand.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/recordlist/Tests/Unit/RecordList/AbstractDatabaseRecordListTest.php [deleted file]
typo3/sysext/recordlist/Tests/UnitDeprecated/RecordList/AbstractDatabaseRecordListTest.php [new file with mode: 0644]
typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
typo3/sysext/reports/Resources/Private/Language/locallang_reports.xlf
typo3/sysext/sys_note/Classes/Domain/Repository/SysNoteRepository.php

index e0f2843..c3eb139 100644 (file)
@@ -218,7 +218,7 @@ class TcaFlexPrepare implements FormDataProviderInterface
                         $context = 'FormEngine did an on-the-fly migration of a flex form data structure. This is deprecated and will be removed.'
                             . ' Merge the following changes into the flex form definition of table "' . $table . '"" in field "' . $fieldName . '"":';
                         array_unshift($messages, $context);
                         $context = 'FormEngine did an on-the-fly migration of a flex form data structure. This is deprecated and will be removed.'
                             . ' Merge the following changes into the flex form definition of table "' . $table . '"" in field "' . $fieldName . '"":';
                         array_unshift($messages, $context);
-                        GeneralUtility::deprecationLog(implode(LF, $messages));
+                        trigger_error(implode(LF, $messages), E_USER_DEPRECATED);
                     }
                     $newSubStructure[$subKey] = $migratedTca['dummyTable']['columns']['dummyField'];
                 }
                     }
                     $newSubStructure[$subKey] = $migratedTca['dummyTable']['columns']['dummyField'];
                 }
index 2bb2b17..ef2e157 100644 (file)
@@ -197,7 +197,7 @@ abstract class AbstractRecordList
      */
     public function __construct()
     {
      */
     public function __construct()
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('The class AbstractRecordList will be removed in TYPO3 v10, as all logic was moved into specific classes that inherited from AbstractRecordList', E_USER_DEPRECATED);
         if (isset($GLOBALS['BE_USER']->uc['titleLen']) && $GLOBALS['BE_USER']->uc['titleLen'] > 0) {
             $this->fixedL = $GLOBALS['BE_USER']->uc['titleLen'];
         }
         if (isset($GLOBALS['BE_USER']->uc['titleLen']) && $GLOBALS['BE_USER']->uc['titleLen'] > 0) {
             $this->fixedL = $GLOBALS['BE_USER']->uc['titleLen'];
         }
index edf7f50..1051c3c 100644 (file)
@@ -397,11 +397,11 @@ function jumpToUrl(URL) {
      * @param bool $textarea A flag you can set for textareas - DEPRECATED as there is no difference any more between the two
      * @param string $styleOverride A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled)
      * @return string Tag attributes for an <input> tag (regarding width)
      * @param bool $textarea A flag you can set for textareas - DEPRECATED as there is no difference any more between the two
      * @param string $styleOverride A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled)
      * @return string Tag attributes for an <input> tag (regarding width)
-     * @deprecated since TYPO3 CMS 9, will be removed in TYPO3 CMS 10.
+     * @deprecated
      */
     public function formWidth($size = 48, $textarea = false, $styleOverride = '')
     {
      */
     public function formWidth($size = 48, $textarea = false, $styleOverride = '')
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('This method will be removed in TYPO3 10 - use responsive code or direct inline styles to format your input fields instead.', E_USER_DEPRECATED);
         return ' style="' . ($styleOverride ?: 'width:' . ceil($size * 9.58) . 'px;') . '"';
     }
 
         return ' style="' . ($styleOverride ?: 'width:' . ceil($size * 9.58) . 'px;') . '"';
     }
 
index adad5d1..b6f6ebb 100644 (file)
@@ -982,11 +982,11 @@ class BackendUtility
      *
      * @param string $fields Field list; $fields specify the fields selected (default: title,uid)
      * @return    array
      *
      * @param string $fields Field list; $fields specify the fields selected (default: title,uid)
      * @return    array
-     * @deprecated since TYPO3 9, will be removed in TYPO3 10
+     * @deprecated
      */
     public static function getListGroupNames($fields = 'title, uid')
     {
      */
     public static function getListGroupNames($fields = 'title, uid')
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('This method will be removed in TYPO3 v10.0, you should generate the list of backend user groups by yourself.', E_USER_DEPRECATED);
         $beUser = static::getBackendUserAuthentication();
         $exQ = '';
         if (!$beUser->isAdmin()) {
         $beUser = static::getBackendUserAuthentication();
         $exQ = '';
         if (!$beUser->isAdmin()) {
index 34b1f8e..c213a82 100644 (file)
@@ -4089,12 +4089,13 @@ class PageLayoutView implements LoggerAwareInterface
      * Method used to log deprecated usage of old buildQueryParametersPostProcess hook arguments
      *
      * @param string $index
      * Method used to log deprecated usage of old buildQueryParametersPostProcess hook arguments
      *
      * @param string $index
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10 - see method usages
+     * @deprecated
      */
     protected function logDeprecation(string $index)
     {
      */
     protected function logDeprecation(string $index)
     {
-        GeneralUtility::deprecationLog(
-            '[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook has been deprecated in v9 and will be remove in v10, use $queryBuilder instead'
+        trigger_error(
+            '[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook has been deprecated in v9 and will be remove in v10, use $queryBuilder instead',
+            E_USER_DEPRECATED
         );
     }
 
         );
     }
 
index 37b32d2..fa34efa 100644 (file)
@@ -303,216 +303,4 @@ class TcaFlexPrepareTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
 
         $this->assertEquals($expected, $this->subject->addData($input));
     }
 
         $this->assertEquals($expected, $this->subject->addData($input));
     }
-
-    /**
-     * @test
-     */
-    public function addDataMigratesFlexformTca()
-    {
-        $input = [
-            'systemLanguageRows' => [],
-            'tableName' => 'aTableName',
-            'databaseRow' => [
-                'aField' => [
-                    'data' => [],
-                    'meta' => [],
-                ],
-            ],
-            'processedTca' => [
-                'columns' => [
-                    'aField' => [
-                        'config' => [
-                            'type' => 'flex',
-                            'ds' => [
-                                'default' => '
-                                    <T3DataStructure>
-                                        <sheets>
-                                            <sDEF>
-                                                <ROOT>
-                                                    <type>array</type>
-                                                    <el>
-                                                        <aFlexField>
-                                                            <TCEforms>
-                                                                <label>aFlexFieldLabel</label>
-                                                                <config>
-                                                                    <type>text</type>
-                                                                    <default>defaultValue</default>
-                                                                    <wizards>
-                                                                        <t3editor>
-                                                                            <type>userFunc</type>
-                                                                            <userFunc>TYPO3\\CMS\\T3editor\\FormWizard->main</userFunc>
-                                                                            <title>t3editor</title>
-                                                                            <icon>content-table</icon>
-                                                                            <module>
-                                                                                <name>wizard_table</name>
-                                                                            </module>
-                                                                            <params>
-                                                                                <format>html</format>
-                                                                            </params>
-                                                                        </t3editor>
-                                                                    </wizards>
-                                                                </config>
-                                                            </TCEforms>
-                                                        </aFlexField>
-                                                    </el>
-                                                </ROOT>
-                                            </sDEF>
-                                        </sheets>
-                                    </T3DataStructure>
-                                ',
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $GLOBALS['TCA']['aTableName']['columns'] = $input['processedTca']['columns'];
-
-        $expected = $input;
-        $expected['processedTca']['columns']['aField']['config']['dataStructureIdentifier']
-            = '{"type":"tca","tableName":"aTableName","fieldName":"aField","dataStructureKey":"default"}';
-        $expected['processedTca']['columns']['aField']['config']['ds'] = [
-            'sheets' => [
-                'sDEF' => [
-                    'ROOT' => [
-                        'type' => 'array',
-                        'el' => [
-                            'aFlexField' => [
-                                'label' => 'aFlexFieldLabel',
-                                'config' => [
-                                    'type' => 'text',
-                                    'default' => 'defaultValue',
-                                    'renderType' => 't3editor',
-                                    'format' => 'html',
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-            'meta' => [],
-        ];
-
-        $this->assertEquals($expected, $this->subject->addData($input));
-    }
-
-    /**
-     * @test
-     */
-    public function addDataMigratesFlexformTcaInContainer()
-    {
-        $input = [
-            'systemLanguageRows' => [],
-            'tableName' => 'aTableName',
-            'databaseRow' => [
-                'aField' => [
-                    'data' => [],
-                    'meta' => [],
-                ],
-            ],
-            'processedTca' => [
-                'columns' => [
-                    'aField' => [
-                        'config' => [
-                            'type' => 'flex',
-                            'ds' => [
-                                'default' => '
-                                    <T3DataStructure>
-                                        <sheets>
-                                            <sDEF>
-                                                <ROOT>
-                                                    <type>array</type>
-                                                    <el>
-                                                        <section_1>
-                                                            <title>section_1</title>
-                                                            <type>array</type>
-                                                            <section>1</section>
-                                                            <el>
-                                                                <aFlexContainer>
-                                                                    <type>array</type>
-                                                                    <title>aFlexContainerLabel</title>
-                                                                    <el>
-                                                                        <aFlexField>
-                                                                            <TCEforms>
-                                                                                <label>aFlexFieldLabel</label>
-                                                                                <config>
-                                                                                    <type>text</type>
-                                                                                    <default>defaultValue</default>
-                                                                                    <wizards>
-                                                                                        <t3editor>
-                                                                                            <type>userFunc</type>
-                                                                                            <userFunc>TYPO3\\CMS\\T3editor\\FormWizard->main</userFunc>
-                                                                                            <title>t3editor</title>
-                                                                                            <icon>content-table</icon>
-                                                                                            <module>
-                                                                                                <name>wizard_table</name>
-                                                                                            </module>
-                                                                                            <params>
-                                                                                                <format>html</format>
-                                                                                            </params>
-                                                                                        </t3editor>
-                                                                                    </wizards>
-                                                                                </config>
-                                                                            </TCEforms>
-                                                                        </aFlexField>
-                                                                    </el>
-                                                                </aFlexContainer>
-                                                            </el>
-                                                        </section_1>
-                                                    </el>
-                                                </ROOT>
-                                            </sDEF>
-                                        </sheets>
-                                    </T3DataStructure>
-                                ',
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $GLOBALS['TCA']['aTableName']['columns'] = $input['processedTca']['columns'];
-
-        $expected = $input;
-        $expected['processedTca']['columns']['aField']['config']['dataStructureIdentifier']
-            = '{"type":"tca","tableName":"aTableName","fieldName":"aField","dataStructureKey":"default"}';
-        $expected['processedTca']['columns']['aField']['config']['ds'] = [
-            'sheets' => [
-                'sDEF' => [
-                    'ROOT' => [
-                        'type' => 'array',
-                        'el' => [
-                            'section_1' => [
-                                'title' => 'section_1',
-                                'type' => 'array',
-                                'section' => '1',
-                                'el' => [
-                                    'aFlexContainer' => [
-                                        'type' => 'array',
-                                        'title' => 'aFlexContainerLabel',
-                                        'el' => [
-                                            'aFlexField' => [
-                                                'label' => 'aFlexFieldLabel',
-                                                'config' => [
-                                                    'type' => 'text',
-                                                    'default' => 'defaultValue',
-                                                    'renderType' => 't3editor',
-                                                    'format' => 'html',
-                                                ],
-                                            ],
-                                        ],
-                                    ],
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-            'meta' => [],
-        ];
-
-        $this->assertEquals($expected, $this->subject->addData($input));
-    }
 }
 }
diff --git a/typo3/sysext/backend/Tests/UnitDeprecated/Form/FormDataProvider/TcaFlexPrepareTest.php b/typo3/sysext/backend/Tests/UnitDeprecated/Form/FormDataProvider/TcaFlexPrepareTest.php
new file mode 100644 (file)
index 0000000..1b1e346
--- /dev/null
@@ -0,0 +1,277 @@
+<?php
+namespace TYPO3\CMS\Backend\Tests\UnitDeprecated\Form\FormDataProvider;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use Prophecy\Argument;
+use Prophecy\Prophecy\ObjectProphecy;
+use TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexPrepare;
+use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Cache\CacheManager;
+use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Test case for TcaFlexPrepare to render the functionality when a TCA migration happened
+ */
+class TcaFlexPrepareTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+{
+    /**
+     * @var TcaFlexPrepare
+     */
+    protected $subject;
+
+    /**
+     * @var BackendUserAuthentication|ObjectProphecy
+     */
+    protected $backendUserProphecy;
+
+    /**
+     * @var array A backup of registered singleton instances
+     */
+    protected $singletonInstances = [];
+
+    protected function setUp()
+    {
+        $this->singletonInstances = GeneralUtility::getSingletonInstances();
+
+        // Suppress cache foo in xml helpers of GeneralUtility
+        /** @var CacheManager|ObjectProphecy $cacheManagerProphecy */
+        $cacheManagerProphecy = $this->prophesize(CacheManager::class);
+        GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
+        $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class);
+        $cacheManagerProphecy->getCache(Argument::cetera())->willReturn($cacheFrontendProphecy->reveal());
+
+        $this->subject = new TcaFlexPrepare();
+    }
+
+    protected function tearDown()
+    {
+        GeneralUtility::purgeInstances();
+        GeneralUtility::resetSingletonInstances($this->singletonInstances);
+        parent::tearDown();
+    }
+
+    /**
+     * @test
+     */
+    public function addDataMigratesFlexformTca()
+    {
+        $input = [
+            'systemLanguageRows' => [],
+            'tableName' => 'aTableName',
+            'databaseRow' => [
+                'aField' => [
+                    'data' => [],
+                    'meta' => [],
+                ],
+            ],
+            'processedTca' => [
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'flex',
+                            'ds' => [
+                                'default' => '
+                                    <T3DataStructure>
+                                        <sheets>
+                                            <sDEF>
+                                                <ROOT>
+                                                    <type>array</type>
+                                                    <el>
+                                                        <aFlexField>
+                                                            <TCEforms>
+                                                                <label>aFlexFieldLabel</label>
+                                                                <config>
+                                                                    <type>text</type>
+                                                                    <default>defaultValue</default>
+                                                                    <wizards>
+                                                                        <t3editor>
+                                                                            <type>userFunc</type>
+                                                                            <userFunc>TYPO3\\CMS\\T3editor\\FormWizard->main</userFunc>
+                                                                            <title>t3editor</title>
+                                                                            <icon>content-table</icon>
+                                                                            <module>
+                                                                                <name>wizard_table</name>
+                                                                            </module>
+                                                                            <params>
+                                                                                <format>html</format>
+                                                                            </params>
+                                                                        </t3editor>
+                                                                    </wizards>
+                                                                </config>
+                                                            </TCEforms>
+                                                        </aFlexField>
+                                                    </el>
+                                                </ROOT>
+                                            </sDEF>
+                                        </sheets>
+                                    </T3DataStructure>
+                                ',
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+
+        $GLOBALS['TCA']['aTableName']['columns'] = $input['processedTca']['columns'];
+
+        $expected = $input;
+        $expected['processedTca']['columns']['aField']['config']['dataStructureIdentifier']
+            = '{"type":"tca","tableName":"aTableName","fieldName":"aField","dataStructureKey":"default"}';
+        $expected['processedTca']['columns']['aField']['config']['ds'] = [
+            'sheets' => [
+                'sDEF' => [
+                    'ROOT' => [
+                        'type' => 'array',
+                        'el' => [
+                            'aFlexField' => [
+                                'label' => 'aFlexFieldLabel',
+                                'config' => [
+                                    'type' => 'text',
+                                    'default' => 'defaultValue',
+                                    'renderType' => 't3editor',
+                                    'format' => 'html',
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+            'meta' => [],
+        ];
+
+        $this->assertEquals($expected, $this->subject->addData($input));
+    }
+
+    /**
+     * @test
+     */
+    public function addDataMigratesFlexformTcaInContainer()
+    {
+        $input = [
+            'systemLanguageRows' => [],
+            'tableName' => 'aTableName',
+            'databaseRow' => [
+                'aField' => [
+                    'data' => [],
+                    'meta' => [],
+                ],
+            ],
+            'processedTca' => [
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'flex',
+                            'ds' => [
+                                'default' => '
+                                    <T3DataStructure>
+                                        <sheets>
+                                            <sDEF>
+                                                <ROOT>
+                                                    <type>array</type>
+                                                    <el>
+                                                        <section_1>
+                                                            <title>section_1</title>
+                                                            <type>array</type>
+                                                            <section>1</section>
+                                                            <el>
+                                                                <aFlexContainer>
+                                                                    <type>array</type>
+                                                                    <title>aFlexContainerLabel</title>
+                                                                    <el>
+                                                                        <aFlexField>
+                                                                            <TCEforms>
+                                                                                <label>aFlexFieldLabel</label>
+                                                                                <config>
+                                                                                    <type>text</type>
+                                                                                    <default>defaultValue</default>
+                                                                                    <wizards>
+                                                                                        <t3editor>
+                                                                                            <type>userFunc</type>
+                                                                                            <userFunc>TYPO3\\CMS\\T3editor\\FormWizard->main</userFunc>
+                                                                                            <title>t3editor</title>
+                                                                                            <icon>content-table</icon>
+                                                                                            <module>
+                                                                                                <name>wizard_table</name>
+                                                                                            </module>
+                                                                                            <params>
+                                                                                                <format>html</format>
+                                                                                            </params>
+                                                                                        </t3editor>
+                                                                                    </wizards>
+                                                                                </config>
+                                                                            </TCEforms>
+                                                                        </aFlexField>
+                                                                    </el>
+                                                                </aFlexContainer>
+                                                            </el>
+                                                        </section_1>
+                                                    </el>
+                                                </ROOT>
+                                            </sDEF>
+                                        </sheets>
+                                    </T3DataStructure>
+                                ',
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+
+        $GLOBALS['TCA']['aTableName']['columns'] = $input['processedTca']['columns'];
+
+        $expected = $input;
+        $expected['processedTca']['columns']['aField']['config']['dataStructureIdentifier']
+            = '{"type":"tca","tableName":"aTableName","fieldName":"aField","dataStructureKey":"default"}';
+        $expected['processedTca']['columns']['aField']['config']['ds'] = [
+            'sheets' => [
+                'sDEF' => [
+                    'ROOT' => [
+                        'type' => 'array',
+                        'el' => [
+                            'section_1' => [
+                                'title' => 'section_1',
+                                'type' => 'array',
+                                'section' => '1',
+                                'el' => [
+                                    'aFlexContainer' => [
+                                        'type' => 'array',
+                                        'title' => 'aFlexContainerLabel',
+                                        'el' => [
+                                            'aFlexField' => [
+                                                'label' => 'aFlexFieldLabel',
+                                                'config' => [
+                                                    'type' => 'text',
+                                                    'default' => 'defaultValue',
+                                                    'renderType' => 't3editor',
+                                                    'format' => 'html',
+                                                ],
+                                            ],
+                                        ],
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+            'meta' => [],
+        ];
+
+        $this->assertEquals($expected, $this->subject->addData($input));
+    }
+}
index 4569939..46e4634 100644 (file)
@@ -8591,9 +8591,11 @@ class DataHandler
                 break;
             case 'temp_cached':
             case 'system':
                 break;
             case 'temp_cached':
             case 'system':
-                GeneralUtility::deprecationLog(
-                    'Calling clear_cacheCmd() with arguments \'temp_cached\' or \'system\', using'
-                    . ' the TS config option \'options.clearCache.system\' has been deprecated.'
+                trigger_error(
+                    'Calling clear_cacheCmd() with arguments "temp_cached" or "system", using'
+                    . ' the TSconfig option "options.clearCache.system" will be removed in TYPO3 v10, use "all"'
+                    . ' instead or call the group cache clearing of "system" group directly via a custom extension.',
+                    E_USER_DEPRECATED
                 );
                 if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.system')) {
                     $this->getCacheManager()->flushCachesInGroup('system');
                 );
                 if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.system')) {
                     $this->getCacheManager()->flushCachesInGroup('system');
index 5403077..fb92554 100644 (file)
@@ -115,6 +115,7 @@ class ErrorHandler implements ErrorHandlerInterface, LoggerAwareInterface
             case E_RECOVERABLE_ERROR:
                 $severity = 2;
                 break;
             case E_RECOVERABLE_ERROR:
                 $severity = 2;
                 break;
+            case E_USER_DEPRECATED:
             case E_USER_WARNING:
             case E_WARNING:
             case E_USER_DEPRECATED:
             case E_USER_WARNING:
             case E_WARNING:
             case E_USER_DEPRECATED:
index ec1d6ef..de3a582 100644 (file)
@@ -689,8 +689,7 @@ class IconRegistry implements SingletonInterface
                 $message = 'The icon "%s" is deprecated since TYPO3 v9 and will be removed in TYPO3 v10.';
                 $arguments = [];
             }
                 $message = 'The icon "%s" is deprecated since TYPO3 v9 and will be removed in TYPO3 v10.';
                 $arguments = [];
             }
-            $deprecationMessage = vsprintf($message, $arguments);
-            GeneralUtility::deprecationLog($deprecationMessage);
+            trigger_error(vsprintf($message, $arguments), E_USER_DEPRECATED);
         }
         return $this->icons[$identifier];
     }
         }
         return $this->icons[$identifier];
     }
index e810a29..8ce02ca 100644 (file)
@@ -14,8 +14,6 @@ namespace TYPO3\CMS\Core\Package;
  * The TYPO3 project - inspiring people to share!
  */
 
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
 /**
  * A Package representing the details of an extension and/or a composer package
  * Adapted from FLOW for TYPO3 CMS
 /**
  * A Package representing the details of an extension and/or a composer package
  * Adapted from FLOW for TYPO3 CMS
@@ -199,7 +197,7 @@ class Package implements PackageInterface
                     // dynamically migrate 'cms' dependency to 'core' dependency
                     // see also \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility::convertDependenciesToObjects
                     if ($packageKey === 'cms') {
                     // dynamically migrate 'cms' dependency to 'core' dependency
                     // see also \TYPO3\CMS\Extensionmanager\Utility\ExtensionModelUtility::convertDependenciesToObjects
                     if ($packageKey === 'cms') {
-                        GeneralUtility::deprecationLog('Extension "' . $this->packageKey . '" defines a dependency on ext:cms, which has been removed. Please remove the dependency.');
+                        trigger_error('Extension "' . $this->packageKey . '" defines a dependency on ext:cms, which has been removed. Please remove the dependency.', E_USER_DEPRECATED);
                         $packageKey = 'core';
                     }
                     $constraint = new MetaData\PackageConstraint(MetaData::CONSTRAINT_TYPE_DEPENDS, $packageKey);
                         $packageKey = 'core';
                     }
                     $constraint = new MetaData\PackageConstraint(MetaData::CONSTRAINT_TYPE_DEPENDS, $packageKey);
index 536c33d..a58d179 100644 (file)
@@ -29,11 +29,11 @@ class BackendUtility
      *
      * @param AbstractFile $file
      * @return FlashMessage
      *
      * @param AbstractFile $file
      * @return FlashMessage
-     * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
+     * @deprecated
      */
     public static function getFlashMessageForMissingFile(AbstractFile $file)
     {
      */
     public static function getFlashMessageForMissingFile(AbstractFile $file)
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('This method will be removed in TYPO3 v10, create the flash message code in your own custom code in the correct context.', E_USER_DEPRECATED);
 
         /** @var LanguageService $lang */
         $lang = $GLOBALS['LANG'];
 
         /** @var LanguageService $lang */
         $lang = $GLOBALS['LANG'];
index f204c4f..28dc2c3 100644 (file)
@@ -150,11 +150,11 @@ abstract class AbstractService implements LoggerAwareInterface
      * @param string $msg Debug message
      * @param int $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
      * @param array|bool $dataVar additional data you want to pass to the logger.
      * @param string $msg Debug message
      * @param int $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
      * @param array|bool $dataVar additional data you want to pass to the logger.
-     * @deprecated since TYPO3 CMS 9, will be removed in TYPO3 CMS 10.
+     * @deprecated
      */
     public function devLog($msg, $severity = 0, $dataVar = false)
     {
      */
     public function devLog($msg, $severity = 0, $dataVar = false)
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('Method devLog() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED);
         $this->logger->debug($this->info['serviceKey'] . ': ' . $msg, (array)$dataVar);
     }
 
         $this->logger->debug($this->info['serviceKey'] . ': ' . $msg, (array)$dataVar);
     }
 
index 9f98695..7395342 100644 (file)
@@ -1664,7 +1664,7 @@ tt_content.' . $key . $suffix . ' {
                 . ' will be removed. The backend module "Configuration -> TCA" shows the modified values.'
                 . ' Please adapt these areas:';
             array_unshift($messages, $context);
                 . ' will be removed. The backend module "Configuration -> TCA" shows the modified values.'
                 . ' Please adapt these areas:';
             array_unshift($messages, $context);
-            GeneralUtility::deprecationLog(implode(LF, $messages));
+            trigger_error(implode(LF, $messages), E_USER_DEPRECATED);
         }
 
         static::emitTcaIsBeingBuiltSignal($GLOBALS['TCA']);
         }
 
         static::emitTcaIsBeingBuiltSignal($GLOBALS['TCA']);
index 1c5586d..b6683b4 100644 (file)
@@ -3427,11 +3427,11 @@ class GeneralUtility
      * @param string $className Class name
      * @return object The instance of the class asked for. Instance is created with GeneralUtility::makeInstance
      * @see callUserFunction()
      * @param string $className Class name
      * @return object The instance of the class asked for. Instance is created with GeneralUtility::makeInstance
      * @see callUserFunction()
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10, use makeInstance instead.
+     * @deprecated
      */
     public static function getUserObj($className)
     {
      */
     public static function getUserObj($className)
     {
-        self::logDeprecatedFunction();
+        trigger_error('This method will be removed in TYPO3 v10.0, use GeneralUtility::makeInstance() directly instead', E_USER_DEPRECATED);
         // Check if class exists:
         if (class_exists($className)) {
             return self::makeInstance($className);
         // Check if class exists:
         if (class_exists($className)) {
             return self::makeInstance($className);
@@ -3789,11 +3789,11 @@ class GeneralUtility
      * @param string $msg Message (in English).
      * @param string $extKey Extension key (from which extension you are calling the log) or "Core"
      * @param int $severity \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_* constant
      * @param string $msg Message (in English).
      * @param string $extKey Extension key (from which extension you are calling the log) or "Core"
      * @param int $severity \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_* constant
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10
+     * @deprecated
      */
     public static function sysLog($msg, $extKey, $severity = 0)
     {
      */
     public static function sysLog($msg, $extKey, $severity = 0)
     {
-        static::logDeprecatedFunction();
+        trigger_error('Method sysLog() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED);
 
         $severity = MathUtility::forceIntegerInRange($severity, 0, 4);
         // Is message worth logging?
 
         $severity = MathUtility::forceIntegerInRange($severity, 0, 4);
         // Is message worth logging?
@@ -3832,11 +3832,11 @@ class GeneralUtility
      * @param string $extKey Extension key (from which extension you are calling the log)
      * @param int $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
      * @param mixed $dataVar Additional data you want to pass to the logger.
      * @param string $extKey Extension key (from which extension you are calling the log)
      * @param int $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
      * @param mixed $dataVar Additional data you want to pass to the logger.
-     * @deprecated since TYPO3 CMS 9, will be removed in TYPO3 CMS 10.
+     * @deprecated
      */
     public static function devLog($msg, $extKey, $severity = 0, $dataVar = false)
     {
      */
     public static function devLog($msg, $extKey, $severity = 0, $dataVar = false)
     {
-        static::logDeprecatedFunction();
+        trigger_error('Method devLog() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED);
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['devLog'])) {
             $params = ['msg' => $msg, 'extKey' => $extKey, 'severity' => $severity, 'dataVar' => $dataVar];
             $fakeThis = false;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['devLog'])) {
             $params = ['msg' => $msg, 'extKey' => $extKey, 'severity' => $severity, 'dataVar' => $dataVar];
             $fakeThis = false;
@@ -3850,34 +3850,12 @@ class GeneralUtility
      * Writes a message to the deprecation log.
      *
      * @param string $msg Message (in English).
      * Writes a message to the deprecation log.
      *
      * @param string $msg Message (in English).
+     * @deprecated
      */
     public static function deprecationLog($msg)
     {
      */
     public static function deprecationLog($msg)
     {
-        if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) {
-            return;
-        }
-        // Legacy values (no strict comparison, $log can be boolean, string or int)
-        $log = $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'];
-        if ($log === true || $log == '1') {
-            $log = ['file'];
-        } else {
-            $log = self::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'], true);
-        }
-        $date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': ');
-        if (in_array('file', $log) !== false) {
-            // Write a longer message to the deprecation log
-            $destination = static::getDeprecationLogFileName();
-            $file = @fopen($destination, 'a');
-            if ($file) {
-                @fwrite($file, ($date . $msg . LF));
-                @fclose($file);
-                self::fixPermissions($destination);
-            }
-        }
-        // Do not use console in login screen
-        if (in_array('console', $log) !== false && isset($GLOBALS['BE_USER']->user['uid'])) {
-            DebugUtility::debug($msg, $date, 'Deprecation Log');
-        }
+        static::writeDeprecationLogFileEntry(__METHOD__ . ' is deprecated since TYPO3 v9.0, will be removed in TYPO3 v10.0, use "trigger_error("Given reason", E_USER_DEPRECATED);" to log deprecations.');
+        trigger_error($msg, E_USER_DEPRECATED);
     }
 
     /**
     }
 
     /**
@@ -3903,9 +3881,11 @@ class GeneralUtility
      * @param string $property
      * @param RenderingContextInterface $renderingContext
      * @param string $additionalMessage
      * @param string $property
      * @param RenderingContextInterface $renderingContext
      * @param string $additionalMessage
+     * @deprecated
      */
     public static function logDeprecatedViewHelperAttribute(string $property, RenderingContextInterface $renderingContext, string $additionalMessage = '')
     {
      */
     public static function logDeprecatedViewHelperAttribute(string $property, RenderingContextInterface $renderingContext, string $additionalMessage = '')
     {
+        static::writeDeprecationLogFileEntry(__METHOD__ . ' is deprecated since TYPO3 v9.0, will be removed in TYPO3 v10.0');
         $template = $renderingContext->getTemplatePaths()->resolveTemplateFileForControllerAndActionAndFormat(
             $renderingContext->getControllerName(),
             $renderingContext->getControllerAction()
         $template = $renderingContext->getTemplatePaths()->resolveTemplateFileForControllerAndActionAndFormat(
             $renderingContext->getControllerName(),
             $renderingContext->getControllerAction()
@@ -3916,28 +3896,29 @@ class GeneralUtility
         $message[] = 'The property "' . $property . '" has been marked as deprecated.';
         $message[] = $additionalMessage;
         $message[] = 'Please check also your partial and layout files of this template';
         $message[] = 'The property "' . $property . '" has been marked as deprecated.';
         $message[] = $additionalMessage;
         $message[] = 'Please check also your partial and layout files of this template';
-        self::deprecationLog(implode(' ', $message));
+        trigger_error(implode(' ', $message), E_USER_DEPRECATED);
     }
 
     /**
      * Gets the absolute path to the deprecation log file.
      *
      * @return string Absolute path to the deprecation log file
     }
 
     /**
      * Gets the absolute path to the deprecation log file.
      *
      * @return string Absolute path to the deprecation log file
+     * @deprecated
      */
     public static function getDeprecationLogFileName()
     {
      */
     public static function getDeprecationLogFileName()
     {
+        static::writeDeprecationLogFileEntry(__METHOD__ . ' is deprecated since TYPO3 v9.0, will be removed in TYPO3 v10.0');
         return PATH_typo3conf . 'deprecation_' . self::shortMD5((PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) . '.log';
     }
 
     /**
      * Logs a call to a deprecated function.
      * The log message will be taken from the annotation.
         return PATH_typo3conf . 'deprecation_' . self::shortMD5((PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) . '.log';
     }
 
     /**
      * Logs a call to a deprecated function.
      * The log message will be taken from the annotation.
+     * @deprecated
      */
     public static function logDeprecatedFunction()
     {
      */
     public static function logDeprecatedFunction()
     {
-        if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) {
-            return;
-        }
+        static::writeDeprecationLogFileEntry(__METHOD__ . ' is deprecated since TYPO3 v9.0, will be removed in TYPO3 v10.0');
         $trail = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
         if ($trail[1]['type']) {
             $function = new \ReflectionMethod($trail[1]['class'], $trail[1]['function']);
         $trail = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
         if ($trail[1]['type']) {
             $function = new \ReflectionMethod($trail[1]['class'], $trail[1]['function']);
@@ -3952,7 +3933,7 @@ class GeneralUtility
         $logMsg = $trail[1]['class'] . $trail[1]['type'] . $trail[1]['function'];
         $logMsg .= '() - ' . $msg . ' - ' . DebugUtility::debugTrail();
         $logMsg .= ' (' . PathUtility::stripPathSitePrefix($function->getFileName()) . '#' . $function->getStartLine() . ')';
         $logMsg = $trail[1]['class'] . $trail[1]['type'] . $trail[1]['function'];
         $logMsg .= '() - ' . $msg . ' - ' . DebugUtility::debugTrail();
         $logMsg .= ' (' . PathUtility::stripPathSitePrefix($function->getFileName()) . '#' . $function->getStartLine() . ')';
-        self::deprecationLog($logMsg);
+        trigger_error($logMsg, E_USER_DEPRECATED);
     }
 
     /**
     }
 
     /**
@@ -4083,4 +4064,21 @@ class GeneralUtility
     {
         return static::makeInstance(LogManager::class)->getLogger(__CLASS__);
     }
     {
         return static::makeInstance(LogManager::class)->getLogger(__CLASS__);
     }
+
+    /**
+     * @param string $msg
+     * @deprecated
+     */
+    private static function writeDeprecationLogFileEntry($msg)
+    {
+        $date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': ');
+        // Write a longer message to the deprecation log
+        $destination = PATH_typo3conf . 'deprecation_' . self::shortMD5(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log';
+        $file = @fopen($destination, 'a');
+        if ($file) {
+            @fwrite($file, $date . $msg . LF);
+            @fclose($file);
+            self::fixPermissions($destination);
+        }
+    }
 }
 }
index a4948d0..f182214 100644 (file)
@@ -90,7 +90,6 @@ return [
         'phpTimeZone' => '',
         'systemLog' => false,
         'systemLogLevel' => 0,
         'phpTimeZone' => '',
         'systemLog' => false,
         'systemLogLevel' => 0,
-        'enableDeprecationLog' => '',
         'UTF8filesystem' => false,
         'systemLocale' => '',
         'systemMaintainers' => null,    // @todo: This will be set up as an empty array once the installer can define a system maintainers
         'UTF8filesystem' => false,
         'systemLocale' => '',
         'systemMaintainers' => null,    // @todo: This will be set up as an empty array once the installer can define a system maintainers
index 50c4e94..db02442 100644 (file)
@@ -150,9 +150,6 @@ SYS:
               '3': 'Severity: Error'
               '4': 'Severity: Fatal Error'
             description: 'Enable the severity of log messages to be logged (see systemLog option) - Only messages with same or higher severity are logged.'
               '3': 'Severity: Error'
               '4': 'Severity: Fatal Error'
             description: 'Enable the severity of log messages to be logged (see systemLog option) - Only messages with same or higher severity are logged.'
-        enableDeprecationLog:
-            type: list
-            description: 'If set, this configuration enables the logging of deprecated methods and functions. The following options are allowed: <dl><dt>String: &quot;file&quot; (or integer &quot;1&quot;)</dt><dd>The log file will be written to typo3conf/deprecation_[hash-value].log</dd><dt>String: &quot;console&quot;<dt><dd>The log will be displayed in the Backend''s Debug Console.</dd></dl>Logging options &quot;file&quot; and &quot;console&quot; can be combined by comma-separating them.'
         UTF8filesystem:
             type: bool
             description: 'If TRUE then TYPO3 uses utf-8 to store file names. This allows for accented Latin letters as well as any other non-latin characters like Cyrillic and Chinese.'
         UTF8filesystem:
             type: bool
             description: 'If TRUE then TYPO3 uses utf-8 to store file names. This allows for accented Latin letters as well as any other non-latin characters like Cyrillic and Chinese.'
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82438-DeprecationMethods.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82438-DeprecationMethods.rst
new file mode 100644 (file)
index 0000000..85892ad
--- /dev/null
@@ -0,0 +1,45 @@
+.. include:: ../../Includes.txt
+
+=========================================
+Deprecation: #82438 - Deprecation methods
+=========================================
+
+See :issue:`82438`
+
+Description
+===========
+
+The deprecation log related methods from GeneralUtility along with a
+related configuration option have been deprecated:
+
+* GeneralUtility::logDeprecatedFunction()
+* GeneralUtility::deprecationLog()
+* GeneralUtility::getDeprecationLogFileName()
+* GeneralUtility::logDeprecatedViewHelperAttribute()
+* $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] has no effect anymore
+
+Deprecations now use PHP method :php:`trigger_error('a message', E_USER_DEPRECATED)` and run
+through the logging and exception stack of the TYPO3 core.  In development context deprecations
+are turned into exceptions by default and ignored in production context.
+
+
+Impact
+======
+
+The file :file:`typo3conf/deprecation_xy.log` is no longer filled by the core. However, if an
+extension still uses methods like :php:`GeneralUtility::logDeprecatedFunction()` it is
+still filled with these messages, and throws an additional PHP E_USER_DEPRECATED message.
+
+
+Affected Installations
+======================
+
+Installations with extensions that use one of the above methods.
+
+
+Migration
+=========
+
+Extension authors should switch to :php:`trigger_error('A useful message', E_USER_DEPRECATED);`
+
+.. index:: PHP-API, FullyScanned
\ No newline at end of file
index 18118e2..9ca32d6 100644 (file)
@@ -4242,25 +4242,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     // Tests concerning deprecation log
     /////////////////////////////////////////////////////////////////////////////////////
 
     // Tests concerning deprecation log
     /////////////////////////////////////////////////////////////////////////////////////
 
-    /**
-     * @test
-     */
-    public function deprecationLogFixesPermissionsOnLogFile()
-    {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
-        }
-        $filePath = PATH_site . GeneralUtilityFixture::DEPRECATION_LOG_PATH;
-        @mkdir(dirname($filePath));
-        $this->testFilesToDelete[] = $filePath;
-        $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] = true;
-        $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask'] = '0777';
-        GeneralUtilityFixture::deprecationLog('foo');
-        clearstatcache();
-        $resultFilePermissions = substr(decoct(fileperms($filePath)), 2);
-        $this->assertEquals('0777', $resultFilePermissions);
-    }
-
     ///////////////////////////////////////////////////
     // Tests concerning callUserFunction
     ///////////////////////////////////////////////////
     ///////////////////////////////////////////////////
     // Tests concerning callUserFunction
     ///////////////////////////////////////////////////
index d515214..f3f3e59 100644 (file)
@@ -230,7 +230,7 @@ tt_content.' . $pluginSignature . ' {
     protected static function checkVendorNameFormat($vendorName, $extensionName)
     {
         if (preg_match('/^[A-Z]/', $vendorName) !== 1) {
     protected static function checkVendorNameFormat($vendorName, $extensionName)
     {
         if (preg_match('/^[A-Z]/', $vendorName) !== 1) {
-            \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The vendor name from tx_' . $extensionName . ' must begin with a capital letter.');
+            trigger_error('The vendor name from tx_' . $extensionName . ' must begin with a capital letter.', E_USER_DEPRECATED);
         }
     }
 
         }
     }
 
index ca5b1ce..17a28f3 100644 (file)
@@ -111,7 +111,7 @@ abstract class AbstractViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\Abst
      */
     protected function registerRenderMethodArguments()
     {
      */
     protected function registerRenderMethodArguments()
     {
-        GeneralUtility::deprecationLog(sprintf('Render method argument support is deprecated (used on class "%s"), switch to initializeArguments and registerArgument.', static::class));
+        trigger_error(sprintf('Render method argument support is deprecated (used on class "%s"), switch to initializeArguments and registerArgument.', static::class), E_USER_DEPRECATED);
 
         $reflectionService = $this->getReflectionService();
         $methodParameters = $reflectionService->getMethodParameters(static::class, 'render');
 
         $reflectionService = $this->getReflectionService();
         $methodParameters = $reflectionService->getMethodParameters(static::class, 'render');
index 7c1a973..86cd76a 100644 (file)
@@ -14,9 +14,6 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
  * The TYPO3 project - inspiring people to share!
  */
 use TYPO3\CMS\Extbase\Mvc\Request;
  * The TYPO3 project - inspiring people to share!
  */
 use TYPO3\CMS\Extbase\Mvc\Request;
-use TYPO3\CMS\Extbase\Reflection\ReflectionService;
-use TYPO3\CMS\Fluid\Core\Exception;
-use TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper;
 use TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture;
 use TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider;
 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
 use TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture;
 use TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider;
 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
@@ -70,107 +67,6 @@ class AbstractViewHelperTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestC
 
     /**
      * @test
 
     /**
      * @test
-     * @dataProvider getCallRenderMethodTestValues
-     * @param array $arguments
-     * @param bool $expectsException
-     */
-    public function registerRenderMethodArgumentsThrowsExceptionOnMissingType(array $arguments, $expectsException = false)
-    {
-        $reflectionService = $this->getMockBuilder(ReflectionService::class)
-            ->setMethods(['getMethodParameters', 'getMethodTagsValues'])
-            ->getMock();
-        $reflectionService->expects($this->once())->method('getMethodParameters')->willReturn(
-            [
-                'param1' => [
-                    'position' => 0,
-                    'byReference' => false,
-                    'optional' => false,
-                    'allowsNull' => true
-                ]
-            ]
-        );
-        $reflectionService->expects($this->once())->method('getMethodTagsValues')->willReturn([]);
-        $fixture = $this->getAccessibleMock(TestViewHelper::class, ['render', 'getReflectionService']);
-        $fixture->expects($this->once())->method('getReflectionService')->willReturn($reflectionService);
-        $this->expectException(Exception::class);
-        $this->callInaccessibleMethod($fixture, 'registerRenderMethodArguments');
-    }
-
-    /**
-     * @test
-     * @dataProvider getCallRenderMethodTestValues
-     * @param array $arguments
-     * @param bool $expectsException
-     */
-    public function callRenderMethodBehavesAsExpected(array $arguments, $expectsException = false)
-    {
-        $reflectionService = $this->getMockBuilder(ReflectionService::class)
-            ->setMethods(['getMethodParameters', 'getMethodTagsValues'])
-            ->getMock();
-        $reflectionService->expects($this->once())->method('getMethodParameters')->willReturn(
-            [
-                'param1' => [
-                    'position' => 0,
-                    'type' => 'integer',
-                    'byReference' => false,
-                    'array' => false,
-                    'optional' => false,
-                    'allowsNull' => true
-                ],
-                'param2' => [
-                    'position' => 1,
-                    'type' => 'array',
-                    'byReference' => false,
-                    'array' => true,
-                    'optional' => false,
-                    'allowsNull' => true
-                ],
-                'param3' => [
-                    'position' => 2,
-                    'type' => 'string',
-                    'byReference' => false,
-                    'array' => false,
-                    'optional' => false,
-                    'allowsNull' => true
-                ],
-            ]
-        );
-        $reflectionService->expects($this->once())->method('getMethodTagsValues')->willReturn(
-            []
-        );
-        $fixture = $this->getAccessibleMock(TestViewHelper::class, ['render', 'getReflectionService']);
-        $namedArguments = array_combine(['param1', 'param2', 'param3'], $arguments);
-        $fixture->expects($this->once())->method('getReflectionService')->willReturn($reflectionService);
-        $this->callInaccessibleMethod($fixture, 'registerRenderMethodArguments');
-        $fixture->setArguments($namedArguments);
-        if ($expectsException) {
-            $exception = new \TYPO3Fluid\Fluid\Core\ViewHelper\Exception('test', 1476108352);
-            $this->expectException(get_class($exception));
-            $fixture->expects($this->once())->method('render')->willThrowException($exception);
-            $this->assertEquals('test', $this->callInaccessibleMethod($fixture, 'callRenderMethod'));
-        } else {
-            $fixture->expects($this->once())
-                ->method('render')
-                ->with($arguments[0], $arguments[1], $arguments[2])
-                ->willReturn('okay');
-            $this->assertEquals('okay', $this->callInaccessibleMethod($fixture, 'callRenderMethod'));
-        }
-    }
-
-    /**
-     * @return array
-     */
-    public function getCallRenderMethodTestValues()
-    {
-        return [
-            [[3, ['bar'], 'baz'], false],
-            [[2, ['baz'], 'bar'], false],
-            [[3, ['bar'], 'baz'], true],
-        ];
-    }
-
-    /**
-     * @test
      */
     public function prepareArgumentsCallsInitializeArguments()
     {
      */
     public function prepareArgumentsCallsInitializeArguments()
     {
@@ -184,30 +80,6 @@ class AbstractViewHelperTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestC
     /**
      * @test
      */
     /**
      * @test
      */
-    public function prepareArgumentsRegistersAnnotationBasedArgumentsWithDescriptionIfDebugModeIsEnabled()
-    {
-        $dataCacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class);
-        $dataCacheMock->expects($this->any())->method('has')->will($this->returnValue(true));
-        $dataCacheMock->expects($this->any())->method('get')->will($this->returnValue([]));
-
-        $reflectionServiceMock = $this->getMockBuilder(ReflectionService::class)->getMock();
-        $reflectionServiceMock->expects($this->once())->method('getMethodParameters')->willReturn(['fake' => ['type' => 'int', 'defaultValue' => 'def']]);
-        $reflectionServiceMock->expects($this->once())->method('getMethodTagsValues')->willReturn(['param']);
-
-        $viewHelper = $this->getMockBuilder(\TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper::class)->setMethods(['getReflectionService'])->getMock();
-        $viewHelper->expects($this->once())->method('getReflectionService')->willReturn($reflectionServiceMock);
-
-        $expected = [
-            'fake' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('fake', 'int', '', false, 'def', true)
-        ];
-
-        $this->callInaccessibleMethod($viewHelper, 'registerRenderMethodArguments');
-        $this->assertAttributeEquals($expected, 'argumentDefinitions', $viewHelper, 'Annotation based arguments were not registered.');
-    }
-
-    /**
-     * @test
-     */
     public function validateArgumentsCallsPrepareArguments()
     {
         $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, ['render', 'prepareArguments'], [], '', false);
     public function validateArgumentsCallsPrepareArguments()
     {
         $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::class, ['render', 'prepareArguments'], [], '', false);
diff --git a/typo3/sysext/fluid/Tests/UnitDeprecated/Core/ViewHelper/AbstractViewHelperTest.php b/typo3/sysext/fluid/Tests/UnitDeprecated/Core/ViewHelper/AbstractViewHelperTest.php
new file mode 100644 (file)
index 0000000..5fcfb81
--- /dev/null
@@ -0,0 +1,191 @@
+<?php
+namespace TYPO3\CMS\Fluid\Tests\UnitDeprecated\Core\ViewHelper;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+use TYPO3\CMS\Extbase\Reflection\ReflectionService;
+use TYPO3\CMS\Fluid\Core\Exception;
+use TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper;
+
+/**
+ * Test case for deprecated functionality to still behave as before
+ */
+class AbstractViewHelperTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+{
+    /**
+     * @var array
+     */
+    protected $fixtureMethodParameters = [
+        'param1' => [
+            'position' => 0,
+            'optional' => false,
+            'type' => 'integer',
+            'defaultValue' => null
+        ],
+        'param2' => [
+            'position' => 1,
+            'optional' => false,
+            'type' => 'array',
+            'array' => true,
+            'defaultValue' => null
+        ],
+        'param3' => [
+            'position' => 2,
+            'optional' => true,
+            'type' => 'string',
+            'array' => false,
+            'defaultValue' => 'default'
+        ],
+    ];
+
+    /**
+     * @var array
+     */
+    protected $fixtureMethodTags = [
+        'param' => [
+            'integer $param1 P1 Stuff',
+            'array $param2 P2 Stuff',
+            'string $param3 P3 Stuff'
+        ]
+    ];
+
+    protected function setUp()
+    {
+        $this->mockReflectionService = $this->createMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class);
+    }
+
+    /**
+     * @test
+     * @dataProvider getCallRenderMethodTestValues
+     * @param array $arguments
+     * @param bool $expectsException
+     */
+    public function registerRenderMethodArgumentsThrowsExceptionOnMissingType(array $arguments, $expectsException = false)
+    {
+        $reflectionService = $this->getMockBuilder(ReflectionService::class)
+            ->setMethods(['getMethodParameters', 'getMethodTagsValues'])
+            ->getMock();
+        $reflectionService->expects($this->once())->method('getMethodParameters')->willReturn(
+            [
+                'param1' => [
+                    'position' => 0,
+                    'byReference' => false,
+                    'optional' => false,
+                    'allowsNull' => true
+                ]
+            ]
+        );
+        $reflectionService->expects($this->once())->method('getMethodTagsValues')->willReturn([]);
+        $fixture = $this->getAccessibleMock(TestViewHelper::class, ['render', 'getReflectionService']);
+        $fixture->expects($this->once())->method('getReflectionService')->willReturn($reflectionService);
+        $this->expectException(Exception::class);
+        $this->callInaccessibleMethod($fixture, 'registerRenderMethodArguments');
+    }
+
+    /**
+     * @test
+     * @dataProvider getCallRenderMethodTestValues
+     * @param array $arguments
+     * @param bool $expectsException
+     */
+    public function callRenderMethodBehavesAsExpected(array $arguments, $expectsException = false)
+    {
+        $reflectionService = $this->getMockBuilder(ReflectionService::class)
+            ->setMethods(['getMethodParameters', 'getMethodTagsValues'])
+            ->getMock();
+        $reflectionService->expects($this->once())->method('getMethodParameters')->willReturn(
+            [
+                'param1' => [
+                    'position' => 0,
+                    'type' => 'integer',
+                    'byReference' => false,
+                    'array' => false,
+                    'optional' => false,
+                    'allowsNull' => true
+                ],
+                'param2' => [
+                    'position' => 1,
+                    'type' => 'array',
+                    'byReference' => false,
+                    'array' => true,
+                    'optional' => false,
+                    'allowsNull' => true
+                ],
+                'param3' => [
+                    'position' => 2,
+                    'type' => 'string',
+                    'byReference' => false,
+                    'array' => false,
+                    'optional' => false,
+                    'allowsNull' => true
+                ],
+            ]
+        );
+        $reflectionService->expects($this->once())->method('getMethodTagsValues')->willReturn(
+            []
+        );
+        $fixture = $this->getAccessibleMock(TestViewHelper::class, ['render', 'getReflectionService']);
+        $namedArguments = array_combine(['param1', 'param2', 'param3'], $arguments);
+        $fixture->expects($this->once())->method('getReflectionService')->willReturn($reflectionService);
+        $this->callInaccessibleMethod($fixture, 'registerRenderMethodArguments');
+        $fixture->setArguments($namedArguments);
+        if ($expectsException) {
+            $exception = new \TYPO3Fluid\Fluid\Core\ViewHelper\Exception('test', 1476108352);
+            $this->expectException(get_class($exception));
+            $fixture->expects($this->once())->method('render')->willThrowException($exception);
+            $this->assertEquals('test', $this->callInaccessibleMethod($fixture, 'callRenderMethod'));
+        } else {
+            $fixture->expects($this->once())
+                ->method('render')
+                ->with($arguments[0], $arguments[1], $arguments[2])
+                ->willReturn('okay');
+            $this->assertEquals('okay', $this->callInaccessibleMethod($fixture, 'callRenderMethod'));
+        }
+    }
+
+    /**
+     * @return array
+     */
+    public function getCallRenderMethodTestValues()
+    {
+        return [
+            [[3, ['bar'], 'baz'], false],
+            [[2, ['baz'], 'bar'], false],
+            [[3, ['bar'], 'baz'], true],
+        ];
+    }
+
+    /**
+     * @test
+     */
+    public function prepareArgumentsRegistersAnnotationBasedArgumentsWithDescriptionIfDebugModeIsEnabled()
+    {
+        $dataCacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class);
+        $dataCacheMock->expects($this->any())->method('has')->will($this->returnValue(true));
+        $dataCacheMock->expects($this->any())->method('get')->will($this->returnValue([]));
+
+        $reflectionServiceMock = $this->getMockBuilder(ReflectionService::class)->getMock();
+        $reflectionServiceMock->expects($this->once())->method('getMethodParameters')->willReturn(['fake' => ['type' => 'int', 'defaultValue' => 'def']]);
+        $reflectionServiceMock->expects($this->once())->method('getMethodTagsValues')->willReturn(['param']);
+
+        $viewHelper = $this->getMockBuilder(\TYPO3\CMS\Fluid\Tests\Unit\Core\Fixtures\TestViewHelper::class)->setMethods(['getReflectionService'])->getMock();
+        $viewHelper->expects($this->once())->method('getReflectionService')->willReturn($reflectionServiceMock);
+
+        $expected = [
+            'fake' => new \TYPO3\CMS\Fluid\Core\ViewHelper\ArgumentDefinition('fake', 'int', '', false, 'def', true)
+        ];
+
+        $this->callInaccessibleMethod($viewHelper, 'registerRenderMethodArguments');
+        $this->assertAttributeEquals($expected, 'argumentDefinitions', $viewHelper, 'Annotation based arguments were not registered.');
+    }
+}
index ffcd252..36e1fea 100644 (file)
@@ -18,7 +18,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
 use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
- * Contains RESTORE_REGISTER class object.
+ * Contains SVG content object.
  */
 class ScalableVectorGraphicsContentObject extends AbstractContentObject
 {
  */
 class ScalableVectorGraphicsContentObject extends AbstractContentObject
 {
@@ -100,10 +100,10 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject
 
         // @deprecated since TYPO3 v9, will be removed in TYPO3 v10 - see method usages
         if (!empty($conf['noscript.']) || !empty($conf['noscript'])) {
 
         // @deprecated since TYPO3 v9, will be removed in TYPO3 v10 - see method usages
         if (!empty($conf['noscript.']) || !empty($conf['noscript'])) {
-            GeneralUtility::deprecationLog('The option "noscript" of the SVG content object has been deprecated in v9 and will be remove in v10.');
+            trigger_error('SVG cObject: The option "noscript" will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
         }
         if (!empty($conf['value.']) || !empty($conf['value'])) {
         }
         if (!empty($conf['value.']) || !empty($conf['value'])) {
-            GeneralUtility::deprecationLog('The option "value" without setting renderMode=inline of the SVG content object has been deprecated in v9 and will be remove in v10.');
+            trigger_error('SVG cObject: The option "value" without setting renderMode=inline will be removed in TYPO3 v10.', E_USER_DEPRECATED);
         }
 
         $content = [];
         }
 
         $content = [];
index 511e986..d47a979 100644 (file)
@@ -3791,7 +3791,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     {
         $explanationText = $explanation !== '' ? ' - ' . $explanation : '';
         $this->getTimeTracker()->setTSlogMessage($typoScriptProperty . ' is deprecated.' . $explanationText, 2);
     {
         $explanationText = $explanation !== '' ? ' - ' . $explanation : '';
         $this->getTimeTracker()->setTSlogMessage($typoScriptProperty . ' is deprecated.' . $explanationText, 2);
-        GeneralUtility::deprecationLog('TypoScript ' . $typoScriptProperty . ' is deprecated' . $explanationText);
+        trigger_error('TypoScript property ' . $typoScriptProperty . ' is deprecated' . $explanationText, E_USER_DEPRECATED);
     }
 
     /********************************************
     }
 
     /********************************************
index 7b3864a..87851d3 100644 (file)
@@ -1188,7 +1188,7 @@ class PageRepository implements LoggerAwareInterface
 
             if ($row) {
                 if ($noWSOL !== null) {
 
             if ($row) {
                 if ($noWSOL !== null) {
-                    GeneralUtility::deprecationLog('The fourth parameter of PageRepository->getRawRecord() has been deprecated, use a SQL statement directly. The parameter will be removed in TYPO3 v10.');
+                    trigger_error('The fourth parameter of PageRepository->getRawRecord() has been deprecated, use a SQL statement directly. The parameter will be removed in TYPO3 v10.', E_USER_DEPRECATED);
                 }
                 // @deprecated - remove this if-clause in TYPO3 v10
                 if (!$noWSOL) {
                 }
                 // @deprecated - remove this if-clause in TYPO3 v10
                 if (!$noWSOL) {
index a93f0dd..e85e5ce 100644 (file)
@@ -62,11 +62,11 @@ class EidUtility
 
     /**
      * Makes TCA available inside eID
 
     /**
      * Makes TCA available inside eID
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10 - this is not needed anymore as TCA is now always available
+     * @deprecated
      */
     public static function initTCA()
     {
      */
     public static function initTCA()
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('This method will be removed in TYPO3 v10. Is not needed anymore within eID scripts as TCA is now available at any time.', E_USER_DEPRECATED);
         // Some badly made extensions attempt to manipulate TCA in a wrong way
         // (inside ext_localconf.php). Therefore $GLOBALS['TCA'] may become an array
         // but in fact it is not loaded. The check below ensure that
         // Some badly made extensions attempt to manipulate TCA in a wrong way
         // (inside ext_localconf.php). Therefore $GLOBALS['TCA'] may become an array
         // but in fact it is not loaded. The check below ensure that
index 5822e12..da776b4 100644 (file)
@@ -29,7 +29,6 @@ class CustomPreset extends Configuration\AbstractCustomPreset implements Configu
         'FE/debug' => '',
         'SYS/devIPmask' => '',
         'SYS/displayErrors' => '',
         'FE/debug' => '',
         'SYS/devIPmask' => '',
         'SYS/displayErrors' => '',
-        'SYS/enableDeprecationLog' => '',
         'SYS/systemLogLevel' => '',
     ];
 }
         'SYS/systemLogLevel' => '',
     ];
 }
index 7255820..e81f3fd 100644 (file)
@@ -39,7 +39,6 @@ class DebugPreset extends Configuration\AbstractPreset
         'FE/debug' => true,
         'SYS/devIPmask' => '*',
         'SYS/displayErrors' => 1,
         'FE/debug' => true,
         'SYS/devIPmask' => '*',
         'SYS/displayErrors' => 1,
-        'SYS/enableDeprecationLog' => 'file',
         'SYS/systemLogLevel' => 0,
         // E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED
         'SYS/exceptionalErrors' => 28674,
         'SYS/systemLogLevel' => 0,
         // E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED
         'SYS/exceptionalErrors' => 28674,
index 94ec8f3..cc385c2 100644 (file)
@@ -39,7 +39,6 @@ class LivePreset extends Configuration\AbstractPreset
         'FE/debug' => false,
         'SYS/devIPmask' => '',
         'SYS/displayErrors' => 0,
         'FE/debug' => false,
         'SYS/devIPmask' => '',
         'SYS/displayErrors' => 0,
-        'SYS/enableDeprecationLog' => false,
         'SYS/systemLogLevel' => 2,
         // E_RECOVERABLE_ERROR
         'SYS/exceptionalErrors' => 4096,
         'SYS/systemLogLevel' => 2,
         // E_RECOVERABLE_ERROR
         'SYS/exceptionalErrors' => 4096,
index 65d637e..421c278 100644 (file)
@@ -114,6 +114,8 @@ class SilentConfigurationUpgradeService
         'SC_OPTIONS/t3lib/class.t3lib_userauth.php/writeDevLog',
         'SC_OPTIONS/t3lib/class.t3lib_userauth.php/writeDevLogBE',
         'SC_OPTIONS/t3lib/class.t3lib_userauth.php/writeDevLogFE',
         'SC_OPTIONS/t3lib/class.t3lib_userauth.php/writeDevLog',
         'SC_OPTIONS/t3lib/class.t3lib_userauth.php/writeDevLogBE',
         'SC_OPTIONS/t3lib/class.t3lib_userauth.php/writeDevLogFE',
+        // #82438
+        'SYS/enableDeprecationLog',
     ];
 
     public function __construct(ConfigurationManager $configurationManager = null)
     ];
 
     public function __construct(ConfigurationManager $configurationManager = null)
index 3aedcc9..e8dc454 100644 (file)
@@ -119,4 +119,9 @@ return [
             'Deprecation-52694-DeprecatedGeneralUtilitydevLog.rst',
         ],
     ],
             'Deprecation-52694-DeprecatedGeneralUtilitydevLog.rst',
         ],
     ],
+    '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'enableDeprecationLog\']' => [
+        'restFiles' => [
+            'Deprecation-82438-DeprecationMethods.rst',
+        ],
+    ],
 ];
 ];
index 5db4b52..7b66ff7 100644 (file)
@@ -435,4 +435,32 @@ return [
             'Breaking-80700-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
             'Breaking-80700-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
+    'TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-82438-DeprecationMethods.rst',
+        ],
+    ],
+    'TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedViewHelperAttribute' => [
+        'numberOfMandatoryArguments' => 2,
+        'maximumNumberOfArguments' => 3,
+        'restFiles' => [
+            'Deprecation-82438-DeprecationMethods.rst',
+        ],
+    ],
+    'TYPO3\CMS\Core\Utility\GeneralUtility::getDeprecationLogFileName' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-82438-DeprecationMethods.rst',
+        ],
+    ],
+    'TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-82438-DeprecationMethods.rst',
+        ],
+    ],
 ];
 ];
index 00664ce..7a3f966 100644 (file)
@@ -81,8 +81,8 @@ class LanguageUpdateCommand extends Command
     {
         if ($this->getName() === 'language:update') {
             $message = 'bin/typo3 language:update is deprecated, use bin/typo3 lang:language:update instead';
     {
         if ($this->getName() === 'language:update') {
             $message = 'bin/typo3 language:update is deprecated, use bin/typo3 lang:language:update instead';
-            GeneralUtility::deprecationLog($message);
             $output->writeln('<error>' . $message . '</error>');
             $output->writeln('<error>' . $message . '</error>');
+            trigger_error($message, E_USER_DEPRECATED);
         }
 
         try {
         }
 
         try {
index a3c4345..3ad9905 100644 (file)
@@ -1478,7 +1478,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
      */
     protected function logDeprecation(string $index)
     {
      */
     protected function logDeprecation(string $index)
     {
-        GeneralUtility::deprecationLog('[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook has been deprecated in v9 and will be remove in v10, use $queryBuilder instead');
+        trigger_error('[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook has been deprecated in v9 and will be remove in v10, use $queryBuilder instead', E_USER_DEPRECATED);
     }
 
     /**
     }
 
     /**
index 2ac113a..5281501 100644 (file)
@@ -3868,9 +3868,7 @@ class DatabaseRecordList
      */
     protected function logDeprecation(string $index)
     {
      */
     protected function logDeprecation(string $index)
     {
-        GeneralUtility::deprecationLog(
-            '[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook has been deprecated in v9 and will be remove in v10, use $queryBuilder instead'
-        );
+        trigger_error('[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook has been deprecated in v9 and will be remove in v10, use $queryBuilder instead', E_USER_DEPRECATED);
     }
 
     /**
     }
 
     /**
diff --git a/typo3/sysext/recordlist/Tests/Unit/RecordList/AbstractDatabaseRecordListTest.php b/typo3/sysext/recordlist/Tests/Unit/RecordList/AbstractDatabaseRecordListTest.php
deleted file mode 100644 (file)
index 8a055cb..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-namespace TYPO3\CMS\Recordlist\Tests\Unit\RecordList;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList;
-
-/**
- * Test case
- */
-class AbstractDatabaseRecordListTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
-{
-    /**
-     * @test
-     * @dataProvider setTableDisplayOrderConvertsStringsDataProvider
-     * @param array $input
-     * @param array $expected
-     */
-    public function setTableDisplayOrderConvertsStringInput(array $input, array $expected)
-    {
-        /** @var AbstractDatabaseRecordList|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $subject */
-        $subject = $this->getAccessibleMock(AbstractDatabaseRecordList::class, ['dummy']);
-        $subject->setTableDisplayOrder($input);
-        $this->assertSame($expected, $subject->_get('tableDisplayOrder'));
-    }
-
-    /**
-     * @return array
-     */
-    public function setTableDisplayOrderConvertsStringsDataProvider()
-    {
-        return [
-            'no information at all' => [
-                [],
-                []
-            ],
-            'string in before' => [
-                [
-                    'tableA' => [
-                        'before' => 'tableB, tableC'
-                    ]
-                ],
-                [
-                    'tableA' => [
-                        'before' => ['tableB', 'tableC']
-                    ]
-                ]
-            ],
-            'array is preserved in before' => [
-                [
-                    'tableA' => [
-                        'before' => ['tableB', 'tableC']
-                    ]
-                ],
-                [
-                    'tableA' => [
-                        'before' => ['tableB', 'tableC']
-                    ]
-                ]
-            ],
-            'array is preserved in before, after is modified' => [
-                [
-                    'tableA' => [
-                        'before' => ['tableB', 'tableC'],
-                        'after' => 'tableD'
-                    ]
-                ],
-                [
-                    'tableA' => [
-                        'before' => ['tableB', 'tableC'],
-                        'after' => ['tableD']
-                    ]
-                ]
-            ],
-        ];
-    }
-
-    /**
-     * @test
-     */
-    public function setTableDisplayOrderThrowsExceptionOnInvalidAfter()
-    {
-        $this->expectException(\UnexpectedValueException::class);
-        $this->expectExceptionCode(1436195934);
-        $test = [
-            'table' => [ 'after' => new \stdClass ]
-        ];
-        $subject = new AbstractDatabaseRecordList();
-        $subject->setTableDisplayOrder($test);
-    }
-
-    /**
-     * @test
-     */
-    public function setTableDisplayOrderThrowsExceptionOnInvalidBefore()
-    {
-        $this->expectException(\UnexpectedValueException::class);
-        $this->expectExceptionCode(1436195933);
-        $test = [
-            'table' => [ 'before' => new \stdClass ]
-        ];
-        $subject = new AbstractDatabaseRecordList();
-        $subject->setTableDisplayOrder($test);
-    }
-}
diff --git a/typo3/sysext/recordlist/Tests/UnitDeprecated/RecordList/AbstractDatabaseRecordListTest.php b/typo3/sysext/recordlist/Tests/UnitDeprecated/RecordList/AbstractDatabaseRecordListTest.php
new file mode 100644 (file)
index 0000000..d41edf7
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+namespace TYPO3\CMS\Recordlist\Tests\UnitDeprecated\RecordList;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList;
+
+/**
+ * Test case
+ */
+class AbstractDatabaseRecordListTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+{
+    /**
+     * @test
+     * @dataProvider setTableDisplayOrderConvertsStringsDataProvider
+     * @param array $input
+     * @param array $expected
+     */
+    public function setTableDisplayOrderConvertsStringInput(array $input, array $expected)
+    {
+        /** @var AbstractDatabaseRecordList|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $subject */
+        $subject = $this->getAccessibleMock(AbstractDatabaseRecordList::class, ['dummy']);
+        $subject->setTableDisplayOrder($input);
+        $this->assertSame($expected, $subject->_get('tableDisplayOrder'));
+    }
+
+    /**
+     * @return array
+     */
+    public function setTableDisplayOrderConvertsStringsDataProvider()
+    {
+        return [
+            'no information at all' => [
+                [],
+                []
+            ],
+            'string in before' => [
+                [
+                    'tableA' => [
+                        'before' => 'tableB, tableC'
+                    ]
+                ],
+                [
+                    'tableA' => [
+                        'before' => ['tableB', 'tableC']
+                    ]
+                ]
+            ],
+            'array is preserved in before' => [
+                [
+                    'tableA' => [
+                        'before' => ['tableB', 'tableC']
+                    ]
+                ],
+                [
+                    'tableA' => [
+                        'before' => ['tableB', 'tableC']
+                    ]
+                ]
+            ],
+            'array is preserved in before, after is modified' => [
+                [
+                    'tableA' => [
+                        'before' => ['tableB', 'tableC'],
+                        'after' => 'tableD'
+                    ]
+                ],
+                [
+                    'tableA' => [
+                        'before' => ['tableB', 'tableC'],
+                        'after' => ['tableD']
+                    ]
+                ]
+            ],
+        ];
+    }
+
+    /**
+     * @test
+     */
+    public function setTableDisplayOrderThrowsExceptionOnInvalidAfter()
+    {
+        $this->expectException(\UnexpectedValueException::class);
+        $this->expectExceptionCode(1436195934);
+        $test = [
+            'table' => [ 'after' => new \stdClass ]
+        ];
+        $subject = new AbstractDatabaseRecordList();
+        $subject->setTableDisplayOrder($test);
+    }
+
+    /**
+     * @test
+     */
+    public function setTableDisplayOrderThrowsExceptionOnInvalidBefore()
+    {
+        $this->expectException(\UnexpectedValueException::class);
+        $this->expectExceptionCode(1436195933);
+        $test = [
+            'table' => [ 'before' => new \stdClass ]
+        ];
+        $subject = new AbstractDatabaseRecordList();
+        $subject->setTableDisplayOrder($test);
+    }
+}
index cbc441b..1aea9be 100644 (file)
@@ -18,11 +18,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
 use TYPO3\CMS\Core\Localization\LanguageService;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
-use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
 use TYPO3\CMS\Reports\Status as ReportStatus;
 use TYPO3\CMS\Reports\StatusProviderInterface;
 
 use TYPO3\CMS\Reports\Status as ReportStatus;
 use TYPO3\CMS\Reports\StatusProviderInterface;
 
@@ -32,30 +29,14 @@ use TYPO3\CMS\Reports\StatusProviderInterface;
 class ConfigurationStatus implements StatusProviderInterface
 {
     /**
 class ConfigurationStatus implements StatusProviderInterface
 {
     /**
-     * 10MB
-     *
-     * @var int
-     */
-    protected $deprecationLogFileSizeWarningThreshold = 10485760;
-
-    /**
-     * 100MB
-     *
-     * @var int
-     */
-    protected $deprecationLogFileSizeErrorThreshold = 104857600;
-
-    /**
      * Determines the Install Tool's status, mainly concerning its protection.
      *
      * @return array List of statuses
      */
     public function getStatus()
     {
      * Determines the Install Tool's status, mainly concerning its protection.
      *
      * @return array List of statuses
      */
     public function getStatus()
     {
-        $this->executeAdminCommand();
         $statuses = [
             'emptyReferenceIndex' => $this->getReferenceIndexStatus(),
         $statuses = [
             'emptyReferenceIndex' => $this->getReferenceIndexStatus(),
-            'deprecationLog' => $this->getDeprecationLogStatus()
         ];
         if ($this->isMemcachedUsed()) {
             $statuses['memcachedConnection'] = $this->getMemcachedConnectionStatus();
         ];
         if ($this->isMemcachedUsed()) {
             $statuses['memcachedConnection'] = $this->getMemcachedConnectionStatus();
@@ -184,40 +165,6 @@ class ConfigurationStatus implements StatusProviderInterface
     }
 
     /**
     }
 
     /**
-     * Provides status information on the deprecation log, whether it's enabled
-     * and if so whether certain limits in file size are reached.
-     *
-     * @return \TYPO3\CMS\Reports\Status The deprecation log status.
-     */
-    protected function getDeprecationLogStatus()
-    {
-        $title = $this->getLanguageService()->getLL('status_configuration_DeprecationLog');
-        $value = $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:disabled');
-        $message = '';
-        $severity = ReportStatus::OK;
-        if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) {
-            $value = $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:enabled');
-            $message = '<p>' . $this->getLanguageService()->getLL('status_configuration_DeprecationLogEnabled') . '</p>';
-            $severity = ReportStatus::NOTICE;
-            $logFile = GeneralUtility::getDeprecationLogFileName();
-            $logFileSize = 0;
-            if (@file_exists($logFile)) {
-                $logFileSize = filesize($logFile);
-                $message .= '<p>' . sprintf($this->getLanguageService()->getLL('status_configuration_DeprecationLogFile'), '<code>' . $this->getDeprecationLogFileLink()) . '</code></p>';
-                $removeDeprecationLogFileUrl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') . '&amp;adminCmd=removeDeprecationLogFile';
-                $message .= '<p>' . sprintf($this->getLanguageService()->getLL('status_configuration_DeprecationLogSize'), GeneralUtility::formatSize($logFileSize)) . ' <a href="' . $removeDeprecationLogFileUrl . '">' . $this->getLanguageService()->getLL('status_configuration_DeprecationLogDeleteLink') . '</a></p>';
-            }
-            if ($logFileSize > $this->deprecationLogFileSizeWarningThreshold) {
-                $severity = ReportStatus::WARNING;
-            }
-            if ($logFileSize > $this->deprecationLogFileSizeErrorThreshold) {
-                $severity = ReportStatus::ERROR;
-            }
-        }
-        return GeneralUtility::makeInstance(ReportStatus::class, $title, $value, $message, $severity);
-    }
-
-    /**
      * Warning, if fileCreateMask has write bit for 'others' set.
      *
      * @return \TYPO3\CMS\Reports\Status The writable status for 'others'
      * Warning, if fileCreateMask has write bit for 'others' set.
      *
      * @return \TYPO3\CMS\Reports\Status The writable status for 'others'
@@ -254,19 +201,6 @@ class ConfigurationStatus implements StatusProviderInterface
     }
 
     /**
     }
 
     /**
-     * Creates a link to the deprecation log file with the absolute path as the
-     * link text.
-     *
-     * @return string Link to the deprecation log file
-     */
-    protected function getDeprecationLogFileLink()
-    {
-        $logFile = GeneralUtility::getDeprecationLogFileName();
-        $linkToLogFile = PathUtility::getAbsoluteWebPath($logFile);
-        return '<a href="' . $linkToLogFile . '">' . $logFile . '</a>';
-    }
-
-    /**
      * Checks if the default connection is a MySQL compatible database instance.
      *
      * @return bool
      * Checks if the default connection is a MySQL compatible database instance.
      *
      * @return bool
@@ -343,44 +277,6 @@ class ConfigurationStatus implements StatusProviderInterface
     }
 
     /**
     }
 
     /**
-     * Executes admin commands.
-     *
-     * Currently implemented commands are:
-     * - Remove deprecation log file
-     */
-    protected function executeAdminCommand()
-    {
-        $command = GeneralUtility::_GET('adminCmd');
-        switch ($command) {
-            case 'removeDeprecationLogFile':
-                self::removeDeprecationLogFile();
-                break;
-            default:
-                // intentionally left blank
-        }
-    }
-
-    /**
-     * Remove deprecation log file.
-     */
-    protected static function removeDeprecationLogFile()
-    {
-        if (@unlink(GeneralUtility::getDeprecationLogFileName())) {
-            $message = $GLOBALS['LANG']->getLL('status_configuration_DeprecationLogDeletedSuccessful');
-            $severity = FlashMessage::OK;
-        } else {
-            $message = $GLOBALS['LANG']->getLL('status_configuration_DeprecationLogDeletionFailed');
-            $severity = FlashMessage::ERROR;
-        }
-        $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $message, '', $severity, true);
-        /** @var FlashMessageService $flashMessageService  */
-        $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
-        /** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
-        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
-        $defaultFlashMessageQueue->enqueue($flashMessage);
-    }
-
-    /**
      * @return LanguageService
      */
     protected function getLanguageService()
      * @return LanguageService
      */
     protected function getLanguageService()
index f72fb0b..fff24e4 100644 (file)
@@ -237,27 +237,6 @@ You can increase the size to 8MB (default on unix) by adding to the httpd.conf:
                        <trans-unit id="status_installEnabledTemporarily">
                                <source>The Install Tool is temporarily enabled. Delete the file "%s" when you have finished setting up TYPO3. If not used the Install Tool will be disabled automatically in %s minutes.</source>
                        </trans-unit>
                        <trans-unit id="status_installEnabledTemporarily">
                                <source>The Install Tool is temporarily enabled. Delete the file "%s" when you have finished setting up TYPO3. If not used the Install Tool will be disabled automatically in %s minutes.</source>
                        </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLog">
-                               <source>Deprecation Log</source>
-                       </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLogEnabled">
-                               <source>The deprecation log tracks whether old APIs are being used in extensions. Depending on the extensions you use and whether they use deprecated APIs it can happen that the log takes up quite some space over time. The more space it takes up, the more it may affect your installation's performance. It is recommended to disable deprecation log in production environments.</source>
-                       </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLogFile">
-                               <source>You can find the deprecation log file at %s.</source>
-                       </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLogSize">
-                               <source>Your deprecation log file currently takes up %s.</source>
-                       </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLogDeleteLink">
-                               <source>Delete deprecation log file.</source>
-                       </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLogDeletedSuccessful">
-                               <source>The deprecation log file was successfully deleted.</source>
-                       </trans-unit>
-                       <trans-unit id="status_configuration_DeprecationLogDeletionFailed">
-                               <source>The deprecation log file could not be deleted!</source>
-                       </trans-unit>
                        <trans-unit id="status_configuration_PhpSafeModeEnabled">
                                <source>PHP INI setting safe_mode "On" is deprecated since PHP 5.3 and is not supported by TYPO3 anymore.</source>
                        </trans-unit>
                        <trans-unit id="status_configuration_PhpSafeModeEnabled">
                                <source>PHP INI setting safe_mode "On" is deprecated since PHP 5.3 and is not supported by TYPO3 anymore.</source>
                        </trans-unit>
index adac5e8..ac6c4f8 100644 (file)
@@ -37,11 +37,11 @@ class SysNoteRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
      * @param string $pids Single PID or comma separated list of PIDs
      * @param \TYPO3\CMS\Extbase\Domain\Model\BackendUser $author The author
      * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
      * @param string $pids Single PID or comma separated list of PIDs
      * @param \TYPO3\CMS\Extbase\Domain\Model\BackendUser $author The author
      * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10
+     * @deprecated
      */
     public function findByPidsAndAuthor($pids, \TYPO3\CMS\Extbase\Domain\Model\BackendUser $author)
     {
      */
     public function findByPidsAndAuthor($pids, \TYPO3\CMS\Extbase\Domain\Model\BackendUser $author)
     {
-        GeneralUtility::logDeprecatedFunction();
+        trigger_error('Method findByPidsAndAuthor() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED);
         $pids = GeneralUtility::intExplode(',', (string)$pids);
         $query = $this->createQuery();
         $query->setOrderings([
         $pids = GeneralUtility::intExplode(',', (string)$pids);
         $query = $this->createQuery();
         $query->setOrderings([