Skip to content

Commit

Permalink
Force clearing PHP clearstatcache and opcache-reset on `Cache::cl…
Browse files Browse the repository at this point in the history
…ear()`
  • Loading branch information
rhukster committed Mar 8, 2018
1 parent 43ca0a2 commit eaac778
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Vendor library updated to latest
* Improved `Session` initialization
* Added ability to set a `theme_var()` option in page frontmatter
* Force clearing PHP `clearstatcache` and `opcache-reset` on `Cache::clear()`
1. [](#bugfix)
* Fixed issue with image alt tag always getting empted out unless set in markdown
* Fixed issue with remote PHP version determination for Grav updates [#1883](https://github.com/getgrav/grav/issues/1883)
Expand Down
8 changes: 8 additions & 0 deletions system/src/Grav/Common/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,14 @@ public static function clearCache($remove = 'standard')
$output[] = '';
}

// Clear stat cache
@clearstatcache();

// Clear opcache
if (function_exists('opcache_reset')) {
@opcache_reset();
}

return $output;
}

Expand Down

0 comments on commit eaac778

Please sign in to comment.