Bug #59432

setLocalConfigurationValueByPath() writes LocalConfiguration.php on each request

Added by Viktor Livakivskyi almost 6 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-06-10
Due date:
% Done:

0%

TYPO3 Version:
6.1
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

Related to TYPO3 Core - Bug #59662: Problem with subsequent calls to $configurationManager->setLocalConfigurationValueByPath and 'LocalConfiguration invalid' Closed 2014-06-19
Related to TYPO3 Core - Bug #60294: If a local file storage is outside the document root, images are sometimes not shown if multiple images are on a page. Closed 2014-07-13

History

#1 Updated by Uwe Trotzek over 5 years 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.

#2 Updated by Mathias Schreiber over 4 years ago

  • Target version deleted (next-patchlevel)

#3 Updated by Christian Kuhn over 3 years ago

wrong usage. the whole class "ConfigurationManager" is marked as @internal. Cite from class head:

 * IMPORTANT:
 *   This class is intended for internal core use ONLY.
 *   Extensions should usually use the resulting $GLOBALS['TYPO3_CONF_VARS'] array,
 *   do not try to modify settings in LocalConfiguration.php with an extension.
 * @internal

#4 Updated by Christian Kuhn over 3 years ago

  • Status changed from New to Rejected

Also available in: Atom PDF