Bug #55252
closedPHP 5.5 and require LocalConfiguration
100%
Description
I tracked down an issue on the 123 installer with dbal #53997 to the point that LocalConfiguration isn't included correctly with "require" on PHP 5.5 wit OPcache. As the OPcache is default on, we should fix this.
TYPO3\CMS\Core\Utility\ConfigurationManager is responsible for handling the LocalConfiguration.php, the DBAL autoloader requests to add adodb and dbal to the required extensions, which fails (or do not work correctly) and this courses an endless redirect loop.
What happens in ConfigurationManager on a write (by adding adodb):
- require LocalConfiguration.php
- Merge array with new configuration for 'EXT/extListArray'
- write LocalConfiguration.php
After this, the old configuration still exists in the OPcache. If we now add dbal:
- require LocalConfiguration.php (The old one from start of process so without adodb)
- Merge array with new configuration for 'EXT/extListArray'
- write LocalConfiguration.php (with dbal but without adodb)
=> Issue 1: We are missing adodb!
The OPcache only checks every 10 seconds (or so) the timestamps (to be fast) so the dbal redirect comes to the point that dbal isn't installed, installs it and does the redirect, till the browser ends this loop after 20 steps.
=> Issue 2: Our written config isn't there after reload.
3 ways to fix, if OPcache is available:
- opcache_compile_file => Available from PHP 5.5.5 onwards, so no option
- opcache_reset => This do not help against issue 1 as the second require will get the same data as the first require, even though opcache_get_status tells us, that no file is in cache. Beside of it clears to much.
- opcache_invalidate is the way to go, after writing the PHP file, which we require self.
IMHO this issue also needs to be fixed for the CachingFramework for the PHP cache and maybe in more places.
To resolve this issue, I would propose to create a new Utility Class, which will provide clearing cache for a file for OPcache, APC and maybe more.
Files
Updated by Markus Klein about 11 years ago
Impressive finding Alex!
+1 for adding the utility class to handle php-side caches.
The consequence is that we need to add extra handling for any upcoming caching technology in our code.
(a pity the caches do not inject themselves into the file-stream drivers to detect write operations to files and do the cache invalidation automatically)
Updated by Alexander Opitz about 11 years ago
- File opcodecache_warning.png opcodecache_warning.png added
State of the patch in screenshot, only Exception Messages are left, so patch will be submited shortly after lunch.
Updated by Gerrit Code Review about 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review about 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review about 11 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Gerrit Code Review almost 11 years ago
Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27024
Updated by Alexander Opitz almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8c12dd0f2e877405adfb4b8fdd3622bd489a7e2f.
Updated by Gerrit Code Review almost 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28048
Updated by Alexander Opitz almost 11 years ago
- Status changed from Under Review to Resolved
- Target version set to 6.2.0
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Resolved to Closed