Skip to content

Commit

Permalink
check if function apc_delete_file() exist before call it (lexik#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdieunidou authored and ubie.io committed Mar 12, 2018
1 parent e6fca8b commit 5cfb433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Translation/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function removeLocalesCacheFiles(array $locales)
*/
protected function invalidateSystemCacheForFile($path)
{
if (ini_get('apc.enabled')) {
if (ini_get('apc.enabled') && function_exists('apc_delete_file')) {
if (apc_exists($path) && !apc_delete_file($path)) {
throw new \RuntimeException(sprintf('Failed to clear APC Cache for file %s', $path));
}
Expand Down

0 comments on commit 5cfb433

Please sign in to comment.