Bug #59432
setLocalConfigurationValueByPath() writes LocalConfiguration.php on each request
Status: | New | Start date: | 2014-06-10 | |
---|---|---|---|---|
Priority: | Could have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | - | Spent time: | - | |
Target version: | next-patchlevel | |||
TYPO3 Version: | 6.1 | Is Regression: | No | |
PHP Version: | 5.5 | Sprint Focus: | ||
Complexity: |
Description
Hi,
Since TYPO3 6.0 it is recommended to not use $GLOBALS['TYPO3_CONF_VARS'], but TYPO3\CMS\Core\Configuration\ConfigurationManager to set and get values from LocalConfiguration.php (and AdditionalCOnfiguration.php).
However, I've found one strange behaviour of ConfigurationManager. Whenever someone uses setLocalConfigurationValueByPath() or setLocalConfigurationValuesByPathValuePairs() ConfigurationManager implicitly writes LocalConfiguration.php. Meaning, that if setLocalConfigurationValueByPath() is invoked from ext_localconf.php, this will cause LocalConfigration.php writes on each request.
Isn't it possible to do a pre-check in set() methods, that option is already set to desired value?
Related issues
History
#1 Updated by Uwe Trotzek about 1 year ago
- Target version set to next-patchlevel
I would say it's a must have because this behaviour leads to the related issues. When one uses setLocalConfigurationValuesByPathValuePairs multitple times in AdditionalConfigiration it could cause an exception because the LocalConfiguration could not be fully written before it's read by another parallel task.
In my opinion the setLocalConfigurationValuesByPathValuePairs should be refactored to not write the additional config to the local config physically. I don't know if it's technically possible.