From 6f27cbf43ed867924fe9a19c9a4cdc94e587e04e Mon Sep 17 00:00:00 2001 From: Susanne Moog Date: Mon, 30 Jul 2018 16:33:03 +0200 Subject: [PATCH] [TASK] Deprecate RuntimeCacheWriter The RuntimeCacheWriter was introduced for the AdminPanel, but the concept has flaws and there are better and cleaner ways to achieve the wanted behavior. Therefore, the RuntimeCacheWriter has been deprecated. see https://review.typo3.org/56828/ Resolves: #85687 Related: #84894 Related: #84044 Releases: master Change-Id: Ib794ddebb8cdf6e1738b81396fa12703a1538119 Reviewed-on: https://review.typo3.org/57726 Reviewed-by: Markus Klein Tested-by: Markus Klein Tested-by: TYPO3com Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez Reviewed-by: Wouter Wolters Tested-by: Wouter Wolters --- .../Classes/Log/Writer/RuntimeCacheWriter.php | 8 ++++ ...tion-85687-DeprecateRuntimeCacheWriter.rst | 38 +++++++++++++++++++ .../ExtensionScanner/Php/ClassNameMatcher.php | 5 +++ 3 files changed, 51 insertions(+) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-85687-DeprecateRuntimeCacheWriter.rst diff --git a/typo3/sysext/core/Classes/Log/Writer/RuntimeCacheWriter.php b/typo3/sysext/core/Classes/Log/Writer/RuntimeCacheWriter.php index 5ee36a39e1c2..363658aaa37e 100644 --- a/typo3/sysext/core/Classes/Log/Writer/RuntimeCacheWriter.php +++ b/typo3/sysext/core/Classes/Log/Writer/RuntimeCacheWriter.php @@ -21,9 +21,17 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Log writer that writes log entries into TYPO3 runtime cache + * @deprecated Deprecated since TYPO3 9, will be removed in v10 */ class RuntimeCacheWriter implements WriterInterface { + public function __construct() + { + trigger_error( + 'RuntimeCacheWriter is deprecated, write your own custom InMemoryLogger instead.', + E_USER_DEPRECATED + ); + } /** * Writes the log record to TYPO3s runtime cache diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85687-DeprecateRuntimeCacheWriter.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85687-DeprecateRuntimeCacheWriter.rst new file mode 100644 index 000000000000..4af57159577d --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85687-DeprecateRuntimeCacheWriter.rst @@ -0,0 +1,38 @@ +.. include:: ../../Includes.txt + +================================================== +Deprecation: #85687 - Deprecate RuntimeCacheWriter +================================================== + +See :issue:`85687` + +Description +=========== + +The RuntimeCacheWriter was introduced in TYPO3 9.3 and misused the TYPO3 Caching Framework to provide InMemoryLogging +for the (rework in progress) AdminPanel. Instead of having a generic LogWriter in the LoggingFramework this belongs +scope-wise to the admin panel and implementation wise separated from the CachingFramework. + +The RuntimeCacheWriter has therefore been deprecated and the AdminPanel will use custom log writers on demand when +they will become necessary. + + +Impact +====== + +Calling RuntimeCacheWriter will throw a deprecation error. + + +Affected Installations +====================== + +Any installation using the RuntimeCacheWriter. + + +Migration +========= + +Write your own CacheWriter (see `\TYPO3\CMS\Core\Log\Writer\WriterInterface`) or - if you need the exact same +functionality - copy the old RuntimeCacheWriter to your own extension scope and use it. + +.. index:: PHP-API, FullyScanned, ext:adminpanel diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index 7f7d4d5790de..348ed36ceb41 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -694,4 +694,9 @@ return [ 'Deprecation-85124-RedirectingUrlHandlerHookConcept.rst', ], ], + 'TYPO3\CMS\Core\Log\Writer\RuntimeCacheWriter' => [ + 'restFiles' => [ + 'Deprecation-85687-DeprecateRuntimeCacheWriter.rst', + ], + ], ]; -- 2.20.1