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