diff options
author | Andrey Andreev <narf@devilix.net> | 2016-03-11 17:12:57 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-03-11 17:12:57 +0100 |
commit | 1be8987176ad422ae6bc8af5c8f148eba9b5dff1 (patch) | |
tree | 66dc8c484270427a1c0972b8fa0dbc9790c61c71 /system/libraries/Cache/drivers/Cache_wincache.php | |
parent | f56068bfd34e3ebc1325b049bf33901d855c7321 (diff) |
Fix a number of CI_Cache bugs
Fixes #4277
Supersedes #4474
Really fixes #4066
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_wincache.php')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_wincache.php | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/system/libraries/Cache/drivers/Cache_wincache.php b/system/libraries/Cache/drivers/Cache_wincache.php index f66080514..d6a0d4fb6 100644 --- a/system/libraries/Cache/drivers/Cache_wincache.php +++ b/system/libraries/Cache/drivers/Cache_wincache.php @@ -52,6 +52,24 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class CI_Cache_wincache extends CI_Driver { /** + * Class constructor + * + * Only present so that an error message is logged + * if APC is not available. + * + * @return void + */ + public function __construct() + { + if ( ! $this->is_supported()) + { + log_message('error', 'Cache: Failed to initialize Wincache; extension not loaded/enabled?'); + } + } + + // ------------------------------------------------------------------------ + + /** * Get * * Look for a value in the cache. If it exists, return the data, @@ -194,13 +212,6 @@ class CI_Cache_wincache extends CI_Driver { */ public function is_supported() { - if ( ! extension_loaded('wincache') OR ! ini_get('wincache.ucenabled')) - { - log_message('debug', 'The Wincache PHP extension must be loaded to use Wincache Cache.'); - return FALSE; - } - - return TRUE; + return (extension_loaded('wincache') && ini_get('wincache.ucenabled')); } - } |