Commit 91fda281 authored by Eric Chavaillaz's avatar Eric Chavaillaz Committed by Stefan Bürk
Browse files

[FEATURE] Show site configurations (YAML) in configuration module

This adds a new entry to the configuration module, displaying
the YAML configuration of all available site configurations.

To properly differentiate between the new entry and the already
existing site configuration related entry, which displays site configurations' TCA configuration is the naming aligned.

Resolves: #99626
Releases: main
Change-Id: I19be73800e10bf38f94c659174c13d03af306922
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77487


Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
parent b93e210a
.. include:: /Includes.rst.txt
.. _feature-99626-1674115749:
====================================================================
Feature: #99626 - Sites configuration (YAML) in configuration module
====================================================================
See :issue:`99626`
Description
===========
Currently, it is difficult to have a global overview of the YAML configuration
of sites (especially the route enhancers). Since those configurations are base
information, it's important for site administrators to have an overview of them.
Therefore, the configuration module does now list all site configurations
with their identifier and corresponding configuration.
Impact
======
It's now possible for site administrators to get an overview of the YAML
configuration of all sites in the configuration module.
.. index:: Backend, ext:lowlevel
......@@ -93,7 +93,8 @@ class ConfigurationModuleProviderCest
'Backend Routes',
'Backend Modules',
'HTTP Middlewares (PSR-15)',
'Site Configuration',
'Sites: TCA configuration',
'Sites: YAML configuration',
'Event Listeners (PSR-14)',
'MFA providers',
];
......
......@@ -20,13 +20,10 @@ namespace TYPO3\CMS\Lowlevel\ConfigurationModuleProvider;
use TYPO3\CMS\Backend\Configuration\SiteTcaConfiguration;
use TYPO3\CMS\Core\Utility\ArrayUtility;
class SiteConfigurationProvider extends AbstractProvider
class SitesTcaConfiguration extends AbstractProvider
{
protected SiteTcaConfiguration $siteTcaConfiguration;
public function __construct(SiteTcaConfiguration $siteTcaConfiguration)
public function __construct(protected readonly SiteTcaConfiguration $siteTcaConfiguration)
{
$this->siteTcaConfiguration = $siteTcaConfiguration;
}
public function getConfiguration(): array
......
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Lowlevel\ConfigurationModuleProvider;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\ArrayUtility;
class SitesYamlConfiguration extends AbstractProvider
{
public function __construct(protected readonly SiteFinder $siteFinder)
{
}
public function getConfiguration(): array
{
$configurationArray = [];
foreach ($this->siteFinder->getAllSites() as $identifier => $site) {
$configurationArray[$identifier] = $site->getConfiguration();
}
ArrayUtility::naturalKeySortRecursive($configurationArray);
return $configurationArray;
}
}
......@@ -145,18 +145,27 @@ services:
- name: 'lowlevel.configuration.module.provider'
identifier: 'httpMiddlewareStacks'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:httpMiddlewareStacks'
before: 'siteConfiguration'
before: 'sitesTcaConfiguration'
after: 'backendModules'
lowlevel.configuration.module.provider.siteconfiguration:
class: 'TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\SiteConfigurationProvider'
lowlevel.configuration.module.provider.sitestcaconfiguration:
class: 'TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\SitesTcaConfiguration'
tags:
- name: 'lowlevel.configuration.module.provider'
identifier: 'siteConfiguration'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:siteConfiguration'
before: 'eventListeners'
identifier: 'sitesTcaConfiguration'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:sitesTcaConfiguration'
before: 'sitesYamlConfiguration'
after: 'httpMiddlewareStacks'
lowlevel.configuration.module.provider.sitesyamlconfiguration:
class: 'TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\SitesYamlConfiguration'
tags:
- name: 'lowlevel.configuration.module.provider'
identifier: 'sitesYamlConfiguration'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:sitesYamlConfiguration'
before: 'eventListeners'
after: 'sitesTcaConfiguration'
lowlevel.configuration.module.provider.eventlisteners:
class: 'TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\EventListenersProvider'
tags:
......@@ -164,7 +173,7 @@ services:
identifier: 'eventListeners'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:eventListeners'
before: 'mfaProviders'
after: 'siteConfiguration'
after: 'sitesYamlConfiguration'
lowlevel.configuration.module.provider.mfaproviders:
class: 'TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\MfaProvidersProvider'
......
......@@ -44,7 +44,8 @@ The Configuration module displays various configuration settings:
- :ref:`Backend Routes <t3coreapi:backend-routing>`
- :ref:`Backend Modules <t3coreapi:backend-modules>`
- :ref:`HTTP Middlewares (PSR-15) <t3coreapi:request-handling>`
- :ref:`Site configuration <t3coreapi:sitehandling>`
- :ref:`Sites: TCA configuration <t3coreapi:sitehandling>`
- :ref:`Sites: YAML configuration <t3coreapi:sitehandling>`
- :ref:`Event listeners (PSR-14) <t3coreapi:EventDispatcher>`
- :ref:`MFA providers <t3coreapi:multi-factor-authentication>`
- :ref:`Soft Reference Parsers <t3coreapi:soft-references>`
......
......@@ -30,8 +30,11 @@
<trans-unit id="httpMiddlewareStacks" resname="httpMiddlewareStacks">
<source>HTTP Middlewares (PSR-15)</source>
</trans-unit>
<trans-unit id="siteConfiguration" resname="siteConfiguration">
<source>Site Configuration</source>
<trans-unit id="sitesTcaConfiguration" resname="sitesTcaConfiguration">
<source>Sites: TCA configuration</source>
</trans-unit>
<trans-unit id="sitesYamlConfiguration" resname="sitesYamlConfiguration">
<source>Sites: YAML configuration</source>
</trans-unit>
<trans-unit id="eventListeners" resname="eventListeners">
<source>Event Listeners (PSR-14)</source>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment