summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers/Cache_apc.php
diff options
context:
space:
mode:
authorJamie Rumbelow <jamie@jamierumbelow.net>2012-04-26 14:27:35 +0200
committerJamie Rumbelow <jamie@jamierumbelow.net>2012-04-26 14:27:35 +0200
commitd6ce1e936d60487ad8ddd099a040fba7d8f88367 (patch)
tree31dcdda9a24e2ed12135659a4e38cb4f35b0af31 /system/libraries/Cache/drivers/Cache_apc.php
parentbcee50ff3247dee71d83bf273e52bc10096cd48c (diff)
parent9e2d5d130eff40592b49337a8ba4d8c170934de1 (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Conflicts: system/core/Loader.php system/database/DB_query_builder.php system/database/drivers/cubrid/cubrid_driver.php system/database/drivers/mssql/mssql_driver.php system/database/drivers/mysql/mysql_driver.php system/database/drivers/mysqli/mysqli_driver.php system/database/drivers/oci8/oci8_driver.php system/database/drivers/odbc/odbc_driver.php system/database/drivers/pdo/pdo_driver.php system/database/drivers/postgre/postgre_driver.php system/database/drivers/sqlite/sqlite_driver.php user_guide_src/source/changelog.rst user_guide_src/source/database/query_builder.rst
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_apc.php')
-rw-r--r--system/libraries/Cache/drivers/Cache_apc.php45
1 files changed, 20 insertions, 25 deletions
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index a3dd46978..59ab67533 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -2,7 +2,7 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 5.1.6 or newer
+ * An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
*
@@ -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