From bef1a378cad780870491ec55e0005fe9e793c4af Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 1 Nov 2022 10:14:33 +0100 Subject: [PATCH] Force PHP opcache_invalidate due to upgrade error reports "Missing version directory" --- index.php | 4 ++++ snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/index.php b/index.php index 6588bda29..8d4f0b67e 100644 --- a/index.php +++ b/index.php @@ -13,5 +13,9 @@ if (file_exists(APP_INDEX_ROOT_PATH.'snappymail/v/'.APP_VERSION.'/include.php')) else { echo '[105] Missing snappymail/v/'.APP_VERSION.'/include.php'; + // opcache_reset is a terrible solution +// is_callable('opcache_reset') && opcache_reset(); + // opcache_invalidate will not do everything + is_callable('opcache_invalidate') && opcache_invalidate(__FILE__, true); exit(105); } diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php b/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php index 9920ddff9..dc86c76c2 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/upgrade.php @@ -207,6 +207,9 @@ abstract class Upgrade } else { throw new \Exception('Extract core files failed'); } + // opcache_reset is a terrible solution +// \is_callable('opcache_reset') && \opcache_reset(); + \is_callable('opcache_invalidate') && \opcache_invalidate($target.'/index.php', true); } finally { $sTmp && \unlink($sTmp); }