From da54cf11a47e6cebdeef442459383afa50355044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Wed, 7 Oct 2015 21:33:43 +0200 Subject: [PATCH] MDL-49329 admin: Call opcache_reset() after installing new plugin code During the testing, I was experiencing weird behaviour - after a single plugin updated was installed, I ended up on admin/index.php?cache=1. I believe it was caused by the missing opcache_reset(). --- lib/classes/plugin_manager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index c8fc476696ad8..4de0ae713e18f 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -1321,10 +1321,16 @@ public function install_remote_plugins(array $plugins, $confirmed, $silent) { if (!$this->unzip_plugin_file($zipfile, $target, $pluginname)) { $silent or $this->mtrace(get_string('error')); $silent or $this->mtrace('Unable to unzip '.$zipfile, PHP_EOL, DEBUG_DEVELOPER); + if (function_exists('opcache_reset')) { + opcache_reset(); + } return false; } $silent or $this->mtrace($ok); } + if (function_exists('opcache_reset')) { + opcache_reset(); + } return true; }