diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-90136-ShowApplicationContextInTheEnvironmentModule.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-90136-ShowApplicationContextInTheEnvironmentModule.rst new file mode 100644 index 0000000000000000000000000000000000000000..6c8847faa88e28bfec12635624a1d19acab2e644 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-90136-ShowApplicationContextInTheEnvironmentModule.rst @@ -0,0 +1,22 @@ +.. include:: ../../Includes.txt + +==================================================================== +Feature: #90136 - Show application context in the Environment module +==================================================================== + +See :issue:`90136` + +Description +=========== + +The "Environment Overview" card in the admin tool will now show the +application context the TYPO3 instance is running with. + + +Impact +====== + +You can now look up the application context from inside the admin tool without +having to log into the TYPO3 backend. + +.. index:: ext:install diff --git a/typo3/sysext/install/Classes/Controller/EnvironmentController.php b/typo3/sysext/install/Classes/Controller/EnvironmentController.php index e90801cd7a01e29dba308b4ed2ca699c91b38ec4..65e09dff4968776e36f1397afdfc0ad22646f6b7 100644 --- a/typo3/sysext/install/Classes/Controller/EnvironmentController.php +++ b/typo3/sysext/install/Classes/Controller/EnvironmentController.php @@ -18,6 +18,7 @@ namespace TYPO3\CMS\Install\Controller; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Symfony\Component\Mime\Address; +use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\FormProtection\FormProtectionFactory; @@ -73,6 +74,7 @@ class EnvironmentController extends AbstractController 'systemInformationCgiDetected' => GeneralUtility::isRunningOnCgiServerApi(), 'systemInformationDatabaseConnections' => $this->getDatabaseConnectionInformation(), 'systemInformationOperatingSystem' => Environment::isWindows() ? 'Windows' : 'Unix', + 'systemInformationApplicationContext' => $this->getApplicationContextInformation(), 'phpVersion' => PHP_VERSION, ]); return new JsonResponse([ @@ -990,6 +992,22 @@ class EnvironmentController extends AbstractController return $connectionInfos; } + /** + * Get details about the application context + * + * @return array + */ + protected function getApplicationContextInformation(): array + { + $applicationContext = Environment::getContext(); + $status = $applicationContext->isProduction() ? InformationStatus::STATUS_OK : InformationStatus::STATUS_WARNING; + + return [ + 'context' => (string)$applicationContext, + 'status' => $status, + ]; + } + /** * Get sender address from configuration * ['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'] diff --git a/typo3/sysext/install/Resources/Private/Templates/Environment/Cards.html b/typo3/sysext/install/Resources/Private/Templates/Environment/Cards.html index d0bae2147900d5fa83ef6ce44eed6eb94582b392..46018d334623f927eda81a0b665eeb78f0bfe75c 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Environment/Cards.html +++ b/typo3/sysext/install/Resources/Private/Templates/Environment/Cards.html @@ -6,7 +6,7 @@ <div class="card card-size-fixed-small"> <f:render partial="Card/Header" arguments="{ title: 'Environment Overview', subtitle: 'Environment', icon: 'Icons/modules/install-show-environment.svg'}" /> <div class="card-content"> - <p class="card-text">Gives an overview of your host environment including its web server, PHP version and selected database.</p> + <p class="card-text">Gives an overview of your host environment including its web server, PHP version, selected database and the application context.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-default" data-modal-size="small" data-require="TYPO3/CMS/Install/Module/Environment/SystemInformation">Show System Information</a> diff --git a/typo3/sysext/install/Resources/Private/Templates/Environment/SystemInformation.html b/typo3/sysext/install/Resources/Private/Templates/Environment/SystemInformation.html index a8242bcef39fca719813f5e9d68e68208f4189d9..8a558ed6b89803e87a29ee82fa668aeb4328da81 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Environment/SystemInformation.html +++ b/typo3/sysext/install/Resources/Private/Templates/Environment/SystemInformation.html @@ -53,6 +53,10 @@ </td> </tr> </f:for> + <tr> + <td>Application Context:</td> + <td><strong class="text-{systemInformationApplicationContext.status}">{systemInformationApplicationContext.context}</strong></td> + </tr> </table> </html>