Feature #77792

Extension Manager and Install Tool ignores values from AdditionalConfiguration.php

Added by M. Stichweh almost 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-09-02
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Overridden configuration in AdditionalConfiguration.php is not processed by the Extension Manager and the Install Tool. So the only way to verify the current configuration is the Configuration tool. But especially the serialized extension configurations are very hard to read.

I have already read the issue #60650 and understand the problems here. But the biggest issue is if you are using TYPO3_CONTEXT dependent configurations. This is a very nice feature of Typo3 and absolutely essential for Continuous Integration. In Typo3 4.x you could specify these context configurations (eg. with the help of the "environment" extension) in context specific files and since these files were included after the configuration in localconf.php they are also recognized by the Extension Manager and installer. Furthermore if you update some value it was appended to the end of localconf.php and overrides the context config too. So everything worked as expected. Now since Typo3 6 you cannot see the current configuration depending on the TYPO3_CONTEXT and you even cannot change it since it is always stored in LocalConfiguration.php which is overridden by the AdditionalConfiguration.php values. Just enabling logging mode for an extension through the Extension Mananger on a production system is not possible for example.

In my opinion it is absolute necessary to see context dependent configurations in Extensions Manager and installer and to have the ability to (temporary) override them though these tools. Otherwise is it very confusing if you see debug configurations on production systems for example.

There could be two approaches to solve this problem, both require explicit configuration files for different contexts. This would also be one step forwards for the application context feature since you would have an easy and intuitive way to configure Typo3 for each environment:

  1. Provide context specific defaults in separate files which are overridden by LocalConfiguration.php (LocalConfiguration.php has higher priority). In this case only the getLocalConfiguration() method in ConfigurationMananger has to be modified to read these context specific files and merge it with the LocalConfiguration. Modifications in Extension Manager or installer would also override context values. But this approach is a little bit different to the current implementation with AdditionalConfiguration.php and you have to ensure that no value is defined in LocalConfiguration.php if you set it in one of the context specific default files
  2. Another solution will be to have static defined configuration files for the different contexts, like LocalConfigurationOverrides.Development.php or LocalConfigurationOverrides.Production.Staging.php, which overrides the LocalConfiguration.php values. The merge is always done in getLocalConfiguration()@so that Extension Manager and installer shows the correct values. If values are modified and written to file you have to check were the current value is read from. So if the value comes from a context specific file, write it there, otherwise write it to @LocalConfiguration.php. In this case you always see what currently is configured and when storing configuration the correct file is modified, so you can also change values via Extension Manager and installer. This means for the ConfigurationManager that getLocalConfiguration() has to merge the configurations, in the modifying methods setLocalConfigurationValueByPath(), setLocalConfigurationValuesByPathValuePairs() and removeLocalConfigurationKeysByPath() it has to check where to store the config and writeLocalConfiguration() needs to know to which file it has to write.

In my projects I already use a modified ConfigurationManager.php where I have implemented the second case. Please find attached the modified class based on Typo3 version 7.6.10. Furthermore the configuration manager could write empty files for the current context to give a hint about this feature to developers.

I would be very happy to see an implementation of the second case or something else in one of the next releases / updates - would be nice for to have it also for version 7.x. And I think it is a must have for the TYPO3_CONTEXT feature to use Typo3 within Continuous Integration environment.

ConfigurationManager.php View - Implementation of case 2 (18.5 KB) M. Stichweh, 2016-09-02 17:14

History

#1 Updated by Susanne Moog almost 3 years ago

  • Tracker changed from Bug to Feature

#2 Updated by Peter Niederlag almost 3 years ago

Strange this bug has been undiscovered for a long time. While it is perfectly reasonable und technically possible to override something like $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['bug_em_template']= 'a:1:{s:4:"demo";s:16:"hello world ADD1";}'; it is not possbile to read or write this value from the extension-manager.

#3 Updated by Jakob Berlin almost 3 years ago

Upvote! Just stumbled over it.

Also available in: Atom PDF