From c0d67ebe438572f9f4dd42287ade11741722fe30 Mon Sep 17 00:00:00 2001 From: Smart-Core Date: Tue, 21 Nov 2017 13:48:52 +0700 Subject: [PATCH] Remove Exceptions on failure --- AcceleratorCacheClearer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AcceleratorCacheClearer.php b/AcceleratorCacheClearer.php index 3f537f6..db53b40 100644 --- a/AcceleratorCacheClearer.php +++ b/AcceleratorCacheClearer.php @@ -48,6 +48,10 @@ public static function clearCache($user = true, $opcode = true) */ private static function clearUserCache() { + if (function_exists('wincache_ucache_clear') && wincache_ucache_clear()) { + return 'Wincache User Cache: success.'; + } + if (function_exists('apcu_clear_cache') && apcu_clear_cache()) { return 'APC User Cache: success.'; } @@ -69,11 +73,7 @@ private static function clearUserCache() return 'XCache User Cache: success.'; } - if (function_exists('wincache_ucache_clear') && wincache_ucache_clear()) { - return 'Wincache User Cache: success.'; - } - - throw new \RuntimeException('User Cache: failure.'); + return 'User Cache: failure.'; } /** @@ -98,6 +98,6 @@ private static function clearOpcodeCache() return 'XCache Opcode Cache: success.'; } - throw new \RuntimeException('Opcode Cache: failure.'); + return 'Opcode Cache: failure.'; } }