From 59823a15a57f83a878d11d1b002f106445cfb5d0 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 7 Dec 2020 12:03:40 +0300 Subject: [PATCH] fix unable using undo windows --- src/RWFileCache.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/RWFileCache.php b/src/RWFileCache.php index aa97fda..f0dfeab 100644 --- a/src/RWFileCache.php +++ b/src/RWFileCache.php @@ -121,13 +121,13 @@ public function get($key) return false; } - if (!function_exists('sys_getloadavg')) { - throw new Exception('Your PHP installation does not support `sys_getloadavg` (Windows?). Please set `unixLoadUpperThreshold` to `-1` in your RWFileCache config.'); - } - if ($this->config['unixLoadUpperThreshold'] == -1) { $unixLoad = [0 => PHP_INT_MAX, 1 => PHP_INT_MAX, 2 => PHP_INT_MAX]; } else { + if (!function_exists('sys_getloadavg')) { + throw new Exception('Your PHP installation does not support `sys_getloadavg` (Windows?). Please set `unixLoadUpperThreshold` to `-1` in your RWFileCache config.'); + } + $unixLoad = sys_getloadavg(); }