From 1336661741594d8ecb6787fc3644f2b0d5e1366d Mon Sep 17 00:00:00 2001
From: Ernesto Baschny <ernst@cron-it.de>
Date: Tue, 4 Mar 2014 21:16:06 +0100
Subject: [PATCH] [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
---
 typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php b/typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php
index 8caf97c5314c..af78c5d8d540 100644
--- a/typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php
+++ b/typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php
@@ -120,7 +120,9 @@ class OpcodeCacheUtility {
 				'canInvalidate' => FALSE,
 				'error' => FALSE,
 				'clearCallback' => function ($fileAbsPath) {
-					xcache_clear_cache(XC_TYPE_PHP);
+					if (!ini_get('xcache.admin.enable_auth')) {
+						xcache_clear_cache(XC_TYPE_PHP);
+					}
 				}
 			),
 
-- 
GitLab