TYPO3 CMS  TYPO3_8-7
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 
21 
26 {
32  public function getStatus()
33  {
34  $statuses = [
35  'PhpModules' => $this->getMissingPhpModulesOfExtensions()
36  ];
37  return $statuses;
38  }
39 
45  protected function getMissingPhpModulesOfExtensions()
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 $classData) {
50  $hookObject = GeneralUtility::getUserObj($classData);
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 }
static makeInstance($className,... $constructorArguments)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']