‪TYPO3CMS  ‪main
TsDebugModule.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
25 
29 #[Autoconfigure(public: true)]
31 {
32  public function ‪getIdentifier(): string
33  {
34  return 'tsdebug';
35  }
36 
37  public function ‪getIconIdentifier(): string
38  {
39  return 'mimetypes-x-content-template-static';
40  }
41 
42  public function ‪getLabel(): string
43  {
44  return $this->‪getLanguageService()->sL(
45  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_tsdebug.xlf:module.label'
46  );
47  }
48 
49  public function ‪getShortInfo(): string
50  {
51  $messageCount = 0;
52  foreach ($this->‪getTimeTracker()->getTypoScriptLogStack() as $log) {
53  $messageCount += count($log['message'] ?? []);
54  }
55  return sprintf(
56  $this->‪getLanguageService()->sL(
57  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_tsdebug.xlf:module.shortinfo'
58  ),
59  $messageCount
60  );
61  }
62 
63  protected function ‪getTimeTracker(): ‪TimeTracker
64  {
65  return GeneralUtility::makeInstance(TimeTracker::class);
66  }
67 }
‪TYPO3\CMS\Adminpanel\Modules\TsDebugModule\getIconIdentifier
‪getIconIdentifier()
Definition: TsDebugModule.php:37
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule
Definition: AbstractModule.php:29
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule\getLanguageService
‪getLanguageService()
Definition: AbstractModule.php:95
‪TYPO3\CMS\Adminpanel\Modules\TsDebugModule
Definition: TsDebugModule.php:31
‪TYPO3\CMS\Adminpanel\ModuleApi\ShortInfoProviderInterface
Definition: ShortInfoProviderInterface.php:30
‪TYPO3\CMS\Adminpanel\Modules\TsDebugModule\getShortInfo
‪getShortInfo()
Definition: TsDebugModule.php:49
‪TYPO3\CMS\Adminpanel\Modules
Definition: CacheModule.php:18
‪TYPO3\CMS\Adminpanel\Modules\TsDebugModule\getTimeTracker
‪getTimeTracker()
Definition: TsDebugModule.php:63
‪TYPO3\CMS\Adminpanel\Modules\TsDebugModule\getLabel
‪getLabel()
Definition: TsDebugModule.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:34
‪TYPO3\CMS\Adminpanel\Modules\TsDebugModule\getIdentifier
‪getIdentifier()
Definition: TsDebugModule.php:32