‪TYPO3CMS  9.5
RuntimeCacheWriter.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
21 
27 {
28  public function ‪__construct()
29  {
30  trigger_error(
31  'RuntimeCacheWriter is deprecated, write your own custom InMemoryLogger instead.',
32  E_USER_DEPRECATED
33  );
34  }
35 
43  public function ‪writeLog(\‪TYPO3\CMS\Core\Log\‪LogRecord $record)
44  {
45  $cacheManager = GeneralUtility::makeInstance(CacheManager::class);
46  $runtimeCache = $cacheManager->getCache('cache_runtime');
47  $component = str_replace('.', '_', $record->getComponent());
48  $runtimeCache->set(sha1(json_encode($record->getData())), $record, [$component]);
49  return $this;
50  }
51 }
‪TYPO3
‪TYPO3\CMS\Core\Log\Writer\RuntimeCacheWriter
Definition: RuntimeCacheWriter.php:27
‪TYPO3\CMS\Core\Log\Writer\RuntimeCacheWriter\__construct
‪__construct()
Definition: RuntimeCacheWriter.php:28
‪TYPO3\CMS\Core\Log\Writer\RuntimeCacheWriter\writeLog
‪TYPO3 CMS Core Log Writer WriterInterface writeLog(\TYPO3\CMS\Core\Log\LogRecord $record)
Definition: RuntimeCacheWriter.php:43
‪TYPO3\CMS\Core\Log\LogRecord
Definition: LogRecord.php:21
‪TYPO3\CMS\Core\Log\Writer\WriterInterface
Definition: WriterInterface.php:21
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:34
‪TYPO3\CMS\Core\Log\Writer
Definition: AbstractWriter.php:2
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45