2 namespace TYPO3\CMS\Core\Service;
32 $xcVersion = phpversion(
'xcache');
34 $supportedCaches = array(
38 'active' => extension_loaded(
'Zend OPcache') && ini_get(
'opcache.enable') ===
'1',
39 'version' => phpversion(
'Zend OPcache'),
44 'canInvalidate' => function_exists(
'opcache_invalidate'),
46 'clearCallback' =>
function ($fileAbsPath) {
47 if ($fileAbsPath !== null && function_exists(
'opcache_invalidate')) {
48 opcache_invalidate($fileAbsPath);
57 'active' => extension_loaded(
'wincache') && ini_get(
'wincache.ocenabled') ===
'1',
58 'version' => phpversion(
'wincache'),
60 'canInvalidate' =>
true,
62 'clearCallback' =>
function ($fileAbsPath) {
63 if ($fileAbsPath !== null) {
64 wincache_refresh_if_changed(array($fileAbsPath));
67 wincache_refresh_if_changed();
74 'active' => extension_loaded(
'xcache'),
75 'version' => $xcVersion,
76 'canReset' => !ini_get(
'xcache.admin.enable_auth'),
77 'canInvalidate' =>
false,
79 'clearCallback' =>
function ($fileAbsPath) {
80 if (!ini_get(
'xcache.admin.enable_auth')) {
81 xcache_clear_cache(XC_TYPE_PHP);
87 $activeCaches = array();
88 foreach ($supportedCaches as $opcodeCache => $properties) {
89 if ($properties[
'active']) {
90 $activeCaches[$opcodeCache] = $properties;
106 $callback = $properties[
'clearCallback'];
107 $callback($fileAbsPath);