Bug #55252

PHP 5.5 and require LocalConfiguration

Added by Alexander Opitz over 5 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Must have
Category:
Miscellaneous
Target version:
Start date:
2014-01-22
Due date:
% Done:

100%

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

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.

opcodecache_warning.png View (67.6 KB) Alexander Opitz, 2014-01-23 13:19


Related issues

Related to TYPO3 Core - Bug #53997: 123 Installer tries to find database before the user is asked to select one. Closed 2013-11-27
Related to TYPO3 Core - Bug #46957: EM: can't install/uninstall extensions Closed 2013-04-05
Related to TYPO3 Core - Bug #55352: TYPO3 breaks if docblock is removed by opcode cache Closed 2014-01-27
Related to TYPO3 Core - Bug #55392: Missing opcode cache throws warning (instead of notice) and triggers mail Closed 2014-01-28
Related to TYPO3 Core - Bug #56532: PackageState.php gets rewritten on every ExtensionManager call (InvalidPackageKeyException) Closed 2014-03-04
Related to TYPO3 Core - Bug #56546: PHP5.3 OpcodeCache issue: "Cannot access static:: when no class scope is active" Closed 2014-03-04
Related to TYPO3 Core - Bug #56554: OpCache XCACHE cannot be cleared if xcache.admin.enable_auth is set Closed 2014-03-04
Related to TYPO3 Core - Bug #56799: Install tool doesn't work on PHP 5.5.9 and MySQL 5.5.x Closed 2014-03-12
Related to TYPO3 Core - Feature #56969: Clear opcode cache after remove/update extension Closed 2014-03-16
Precedes TYPO3 Core - Task #56526: Link to a wiki page from installer, if opcode cache isn't optimal Closed 2014-03-04

Associated revisions

Revision 8c12dd0f (diff)
Added by Alexander Opitz over 5 years ago

[BUGFIX] Flush opcode caches while saving PHP files.

After manipulating PHP files, which we include with "require" we should
clear the opcode cache, if there is one installed.

So we introduce OpcodeCacheUtility to handle the clearing of the opcode
cache. Also to have a way to give feedback to the install tool which
can show the quality of the opcode cache in use. It also checks if an
opcode cache is enabled in the configuration, not only if the extension
is installed.

Use of this opcode cache clearing is added to the ConfigurationManager,
PackageManager and the cache (Simple)FileBackend.

Make use of this data in the SystemEnvironmentCheck.

Resolves: #55252
Releases: 6.2, 6.1, 6.0
Change-Id: I881f3fbe055c9566663c2c3c238de62ae30f7149
Reviewed-on: https://review.typo3.org/27024
Reviewed-by: Markus Klein
Tested-by: Markus Klein

Revision d12424f1 (diff)
Added by Alexander Opitz over 5 years ago

[BUGFIX] Fix OpcodeCache for PHP 5.3

In PHP 5.3 anonymous functions can't be bound to static/self so an extra
call to a public function is needed.

Resolves: #56546
Related: #55252
Releases: 6.2
Change-Id: I56fc8c4ae92e50c35e972413540b43ec1fa714fc
Reviewed-on: https://review.typo3.org/28048
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers

Revision 13366617 (diff)
Added by Ernesto Baschny over 5 years ago

[BUGFIX] OpCache XCache cannot be cleared if xcache.admin.enable_auth

We can only clear the opcache in XCache if xcache.admin.enable_auth is not
set, else you get a fatal error.

Resolves: #56554
Related: #55252
Releases: 6.2
Change-Id: Ia33afc4141852c58266f6c7dfedec82f4c35148d
Reviewed-on: https://review.typo3.org/28059
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny

History

#1 Updated by Markus Klein over 5 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)

#2 Updated by Alexander Opitz over 5 years ago

State of the patch in screenshot, only Exception Messages are left, so patch will be submited shortly after lunch.

#3 Updated by Gerrit Code Review over 5 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

#4 Updated by Gerrit Code Review over 5 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

#5 Updated by Gerrit Code Review over 5 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

#6 Updated by Gerrit Code Review over 5 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

#7 Updated by Gerrit Code Review over 5 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

#8 Updated by Gerrit Code Review over 5 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

#9 Updated by Gerrit Code Review over 5 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

#10 Updated by Gerrit Code Review over 5 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

#11 Updated by Gerrit Code Review over 5 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

#12 Updated by Gerrit Code Review over 5 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

#13 Updated by Gerrit Code Review over 5 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

#14 Updated by Gerrit Code Review over 5 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

#15 Updated by Gerrit Code Review over 5 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

#16 Updated by Gerrit Code Review over 5 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

#17 Updated by Gerrit Code Review over 5 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

#18 Updated by Gerrit Code Review over 5 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

#19 Updated by Gerrit Code Review over 5 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

#20 Updated by Gerrit Code Review over 5 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

#21 Updated by Gerrit Code Review over 5 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

#22 Updated by Alexander Opitz over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#23 Updated by Gerrit Code Review over 5 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

#24 Updated by Alexander Opitz over 5 years ago

  • Status changed from Under Review to Resolved
  • Target version set to 6.2.0

#25 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF