Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add opcache clear to our normal clearcache operation. #4507

Merged
merged 1 commit into from
Oct 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Zikula/CoreBundle/CacheClearer.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ public function doClear(): void
$this->logger->notice(sprintf('Cache cleared: %s', $cacheType));
}
}
if (function_exists('opcache_reset') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
// This is a brute force clear of _all_ the cached files
// because simply clearing the files in $this->cachesToClear isn't enough.
// Perhaps if we could discern exactly which files to invalidate, we could
// take a more precise approach with @opcache_invalidate($file, true).
@opcache_reset();
$this->logger->notice('OPCache cleared!');
}
// the cache must be warmed after deleting files
$this->warmer->warmUp($this->cacheDir);
}
Expand Down