summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers/Cache_apc.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-06 20:26:09 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-06 20:26:09 +0200
commitd65c3b5d057f4bc48e25cf3f968ceec844ebd155 (patch)
tree5636e0e5479f0ec71b4e3ef0b38496cc5acd0d0f /system/libraries/Cache/drivers/Cache_apc.php
parent2a23e4ad2b71f26262964ac49819ef0a7aebbb9a (diff)
parentea09a8a5552f2aacdeab0c88a605fe44047ebd0a (diff)
Merge upstream branch
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_apc.php')
-rw-r--r--system/libraries/Cache/drivers/Cache_apc.php43
1 files changed, 19 insertions, 24 deletions
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index c387a30fc..59ab67533 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter APC Caching Class
*
@@ -36,23 +34,22 @@
* @author EllisLab Dev Team
* @link
*/
-
class CI_Cache_apc extends CI_Driver {
/**
* Get
*
- * Look for a value in the cache. If it exists, return the data
+ * Look for a value in the cache. If it exists, return the data
* if not, return FALSE
*
- * @param string
- * @return mixed value that is stored/FALSE on failure
+ * @param string
+ * @return mixed value that is stored/FALSE on failure
*/
public function get($id)
{
$data = apc_fetch($id);
- return (is_array($data)) ? $data[0] : FALSE;
+ return is_array($data) ? $data[0] : FALSE;
}
// ------------------------------------------------------------------------
@@ -60,11 +57,11 @@ class CI_Cache_apc extends CI_Driver {
/**
* Cache Save
*
- * @param string Unique Key
- * @param mixed Data to store
- * @param int Length of time (in seconds) to cache the data
+ * @param string Unique Key
+ * @param mixed Data to store
+ * @param int Length of time (in seconds) to cache the data
*
- * @return boolean true on success/false on failure
+ * @return bool true on success/false on failure
*/
public function save($id, $data, $ttl = 60)
{
@@ -77,8 +74,8 @@ class CI_Cache_apc extends CI_Driver {
/**
* Delete from Cache
*
- * @param mixed unique identifier of the item in the cache
- * @param boolean true on success/false on failure
+ * @param mixed unique identifier of the item in the cache
+ * @param bool true on success/false on failure
*/
public function delete($id)
{
@@ -90,7 +87,7 @@ class CI_Cache_apc extends CI_Driver {
/**
* Clean the cache
*
- * @return boolean false on failure/true on success
+ * @return bool false on failure/true on success
*/
public function clean()
{
@@ -102,8 +99,8 @@ class CI_Cache_apc extends CI_Driver {
/**
* Cache Info
*
- * @param string user/filehits
- * @return mixed array on success, false on failure
+ * @param string user/filehits
+ * @return mixed array on success, false on failure
*/
public function cache_info($type = NULL)
{
@@ -115,8 +112,8 @@ class CI_Cache_apc extends CI_Driver {
/**
* Get Cache Metadata
*
- * @param mixed key to get cache metadata on
- * @return mixed array on success/false on failure
+ * @param mixed key to get cache metadata on
+ * @return mixed array on success/false on failure
*/
public function get_metadata($id)
{
@@ -142,10 +139,12 @@ class CI_Cache_apc extends CI_Driver {
* is_supported()
*
* Check to see if APC is available on this system, bail if it isn't.
+ *
+ * @return bool
*/
public function is_supported()
{
- if ( ! extension_loaded('apc') OR ini_get('apc.enabled') != "1")
+ if ( ! extension_loaded('apc') OR ! (bool) @ini_get('apc.enabled'))
{
log_message('error', 'The APC PHP extension must be loaded to use APC Cache.');
return FALSE;
@@ -154,11 +153,7 @@ class CI_Cache_apc extends CI_Driver {
return TRUE;
}
- // ------------------------------------------------------------------------
-
-
}
-// End Class
/* End of file Cache_apc.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */
+/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ \ No newline at end of file