From bedee37f92616a0d21f073d8049b32befe5fe512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech> Date: Sat, 6 Jan 2024 23:49:50 +0100 Subject: [PATCH] [BUGFIX] Check all method for existence in `OpcodeCacheService` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `\TYPO3\CMS\Core\Service\OpcodeCacheService->isClearable()` method checks for existence of opcache function and if they are listed in the `disable_functions` configuration. It seems, that in some environments both methods are missing and not listed in the disabled methods. Even if this sounds odd when the opcache extension is installed but both methods are not available, we add it to the check to avoid the missleading error message: Call to undefined function TYPO3\CMS\Core\Service\opcache_reset() Resolves: #102734 Releases: main, 12.4, 11.5 Change-Id: Icc17a276e8881f502a687db7ca57fc05ecb8981e Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82384 Tested-by: core-ci <typo3@b13.com> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Stefan Bürk <stefan@buerk.tech> --- typo3/sysext/core/Classes/Service/OpcodeCacheService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typo3/sysext/core/Classes/Service/OpcodeCacheService.php b/typo3/sysext/core/Classes/Service/OpcodeCacheService.php index c6ac3f7642d3..34c0ec0d3db6 100644 --- a/typo3/sysext/core/Classes/Service/OpcodeCacheService.php +++ b/typo3/sysext/core/Classes/Service/OpcodeCacheService.php @@ -71,6 +71,8 @@ class OpcodeCacheService protected static function isClearable(): bool { $disabled = explode(',', (string)ini_get('disable_functions')); - return function_exists('opcache_invalidate') && !(in_array('opcache_invalidate', $disabled, true) || in_array('opcache_reset', $disabled, true)); + return function_exists('opcache_invalidate') + && function_exists('opcache_reset') + && !(in_array('opcache_invalidate', $disabled, true) || in_array('opcache_reset', $disabled, true)); } } -- GitLab