‪TYPO3CMS  9.5
SystemStatus.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 use ‪TYPO3\CMS\Reports\Status as ReportStatus;
21 
26 {
32  public function ‪getStatus()
33  {
34  $statuses = [
35  'PhpModules' => $this->‪getMissingPhpModulesOfExtensions()
36  ];
37  return $statuses;
38  }
39 
46  {
47  $modules = [];
48  if (is_array(${‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']})) {
49  foreach (${‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']} as $className) {
50  $hookObject = GeneralUtility::makeInstance($className);
51  $modules = $hookObject->setRequiredPhpModules($modules, $this);
52  }
53  }
54  $missingPhpModules = [];
55  foreach ($modules as $module) {
56  if (is_array($module)) {
57  $detectedSubmodules = false;
58  foreach ($module as $submodule) {
59  if (extension_loaded($submodule)) {
60  $detectedSubmodules = true;
61  }
62  }
63  if ($detectedSubmodules === false) {
64  $missingPhpModules[] = sprintf($this->‪getLanguageService()->getLL('status_phpModulesGroup'), '(' . implode(', ', $module) . ')');
65  }
66  } elseif (!extension_loaded($module)) {
67  $missingPhpModules[] = $module;
68  }
69  }
70  if (!empty($missingPhpModules)) {
71  $value = $this->‪getLanguageService()->‪getLL('status_phpModulesMissing');
72  $message = sprintf($this->‪getLanguageService()->getLL('status_phpModulesList'), implode(', ', $missingPhpModules));
73  $message .= ' ' . $this->‪getLanguageService()->‪getLL('status_phpModulesInfo');
74  $severity = ReportStatus::ERROR;
75  } else {
76  $value = $this->‪getLanguageService()->‪getLL('status_phpModulesPresent');
77  $message = '';
78  $severity = ReportStatus::OK;
79  }
80  return GeneralUtility::makeInstance(ReportStatus::class, $this->‪getLanguageService()->getLL('status_phpModules'), $value, $message, $severity);
81  }
82 
86  protected function ‪getLanguageService()
87  {
88  return ‪$GLOBALS['LANG'];
89  }
90 }
‪TYPO3\CMS\Reports\StatusProviderInterface
Definition: StatusProviderInterface.php:21
‪TYPO3\CMS\Reports\Report\Status\SystemStatus\getMissingPhpModulesOfExtensions
‪TYPO3 CMS Reports Status getMissingPhpModulesOfExtensions()
Definition: SystemStatus.php:45
‪TYPO3\CMS\Reports\Report\Status\SystemStatus\getStatus
‪array getStatus()
Definition: SystemStatus.php:32
‪TYPO3\CMS\Reports\Status
Definition: Status.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Reports\Report\Status
Definition: ConfigurationStatus.php:2
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Core\Localization\LanguageService\getLL
‪string getLL($index)
Definition: LanguageService.php:118
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Reports\Report\Status\SystemStatus\getLanguageService
‪LanguageService getLanguageService()
Definition: SystemStatus.php:86
‪TYPO3\CMS\Reports\Report\Status\SystemStatus
Definition: SystemStatus.php:26