summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers/Cache_apc.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-11 20:04:43 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-11 20:04:43 +0100
commita190d78a0238a0a6abd463823321bef15713e312 (patch)
treea4e49327f8e6ca1660018cebf3b06131ae3e5faf /system/libraries/Cache/drivers/Cache_apc.php
parent3b74f57cfa6c43eab4c7cce440a454d095974a45 (diff)
parent4f9b20ae507dda7379d392386fb7ce5702626a91 (diff)
Merge branch '3.0-stable' into develop
Resolved conflicts: system/core/CodeIgniter.php user_guide_src/source/changelog.rst user_guide_src/source/conf.py user_guide_src/source/installation/downloads.rst user_guide_src/source/installation/upgrading.rst
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_apc.php')
-rw-r--r--system/libraries/Cache/drivers/Cache_apc.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index dd18e7bc8..07ea8f474 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -49,6 +49,24 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class CI_Cache_apc 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 APC; extension not loaded/enabled?');
+ }
+ }
+
+ // ------------------------------------------------------------------------
+
+ /**
* Get
*
* Look for a value in the cache. If it exists, return the data
@@ -198,13 +216,6 @@ class CI_Cache_apc extends CI_Driver {
*/
public function is_supported()
{
- if ( ! extension_loaded('apc') OR ! ini_get('apc.enabled'))
- {
- log_message('debug', 'The APC PHP extension must be loaded to use APC Cache.');
- return FALSE;
- }
-
- return TRUE;
+ return (extension_loaded('apc') && ini_get('apc.enabled'));
}
-
}