‪TYPO3CMS  9.5
PhpInformation.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 
19 use Psr\Http\Message\ServerRequestInterface;
25 
32 {
36  public function ‪getIdentifier(): string
37  {
38  return 'info_php';
39  }
40 
44  public function ‪getLabel(): string
45  {
46  return $this->‪getLanguageService()->‪sL(
47  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_info.xlf:sub.php.label'
48  );
49  }
50 
54  public function ‪getDataToStore(ServerRequestInterface $request): ‪ModuleData
55  {
56  return new ‪ModuleData(
57  [
58  'general' => [
59  'PHP_VERSION' => PHP_VERSION,
60  'PHP_OS' => PHP_OS,
61  'PHP_SAPI' => PHP_SAPI,
62  'Peak Memory Usage' => GeneralUtility::formatSize(memory_get_peak_usage()),
63  ],
64  'loadedExtensions' => implode(', ', get_loaded_extensions()),
65  'constants' => get_defined_constants(true),
66  ]
67  );
68  }
69 
73  public function ‪getContent(‪ModuleData $data): string
74  {
75  $view = GeneralUtility::makeInstance(StandaloneView::class);
76  $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Info/PhpInfo.html';
77  $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
78  $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
79 
80  $view->assignMultiple($data->getArrayCopy());
81 
82  return $view->render();
83  }
84 }
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractSubModule.php:33
‪TYPO3\CMS\Adminpanel\Modules\Info\PhpInformation
Definition: PhpInformation.php:32
‪TYPO3\CMS\Adminpanel\Modules\Info\PhpInformation\getLabel
‪getLabel()
Definition: PhpInformation.php:44
‪TYPO3\CMS\Adminpanel\ModuleApi\DataProviderInterface
Definition: DataProviderInterface.php:29
‪TYPO3\CMS\Adminpanel\Modules\Info\PhpInformation\getContent
‪getContent(ModuleData $data)
Definition: PhpInformation.php:73
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:158
‪TYPO3\CMS\Adminpanel\Modules\Info
Definition: GeneralInformation.php:4
‪TYPO3\CMS\Adminpanel\Modules\Info\PhpInformation\getIdentifier
‪getIdentifier()
Definition: PhpInformation.php:36
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:32
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleData
Definition: ModuleData.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Adminpanel\Modules\Info\PhpInformation\getDataToStore
‪getDataToStore(ServerRequestInterface $request)
Definition: PhpInformation.php:54
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule
Definition: AbstractSubModule.php:27