Skip to content

Instantly share code, notes, and snippets.

@kyletaylored
Created May 17, 2023 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyletaylored/5e3b3f5480afc5827e87a47ef61f7197 to your computer and use it in GitHub Desktop.
Save kyletaylored/5e3b3f5480afc5827e87a47ef61f7197 to your computer and use it in GitHub Desktop.
A one-liner for checking opcache information using cachetool and WP CLI or Drush.
(wp|drush) eval '$cachetool=sys_get_temp_dir()."/cachetool.phar";$old="https://gordalina.github.io/cachetool/downloads/cachetool-3.2.2.phar";$new="https://github.com/gordalina/cachetool/releases/download/8.5.0/cachetool.phar";$url=(version_compare(phpversion(), "8") < 0) ? $old : $new;file_put_contents($cachetool, file_get_contents($url));chmod($cachetool, 0755);echo shell_exec("php $cachetool opcache:status --fcgi=/shared-run/php-fpm.sock");unlink($cachetool);'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment