Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -3,20 +3,20 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* This class acts as a cache layer, allowing you to store and retrieve data in
|
||||
* external cache sources such as memcache or APC
|
||||
* Last Updated: $Date: 2010-01-15 10:18:25 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-03-11 12:41:48 -0500 (Fri, 11 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Kernel
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 370 $
|
||||
* @version $Revision: 8042 $
|
||||
*
|
||||
* Basic Usage Examples
|
||||
* <code>
|
||||
@@ -35,15 +35,14 @@ class classCacheDiskcache implements interfaceCache
|
||||
{
|
||||
/**
|
||||
* Identifier
|
||||
* @access private
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $identifier = '';
|
||||
protected $identifier = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param string Unique identifier
|
||||
* @return boolean Initiation successful
|
||||
*/
|
||||
@@ -55,7 +54,7 @@ class classCacheDiskcache implements interfaceCache
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !file_exists( DOC_IPS_ROOT_PATH . 'cache/diskcache_lock.php' ) )
|
||||
if( !is_file( DOC_IPS_ROOT_PATH . 'cache/diskcache_lock.php' ) )
|
||||
{
|
||||
$fh = @fopen( DOC_IPS_ROOT_PATH . 'cache/diskcache_lock.php', 'wb' );
|
||||
|
||||
@@ -74,7 +73,6 @@ class classCacheDiskcache implements interfaceCache
|
||||
/**
|
||||
* Put data into remote cache store
|
||||
*
|
||||
* @access public
|
||||
* @param string Cache unique key
|
||||
* @param string Cache value to add
|
||||
* @param integer [Optional] Time to live
|
||||
@@ -115,7 +113,7 @@ class classCacheDiskcache implements interfaceCache
|
||||
flock( $fh, LOCK_UN );
|
||||
fclose( $fh );
|
||||
|
||||
@chmod( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php', 0777 );
|
||||
@chmod( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php', IPS_FILE_PERMISSION );
|
||||
|
||||
flock( $lock, LOCK_UN );
|
||||
fclose( $lock );
|
||||
@@ -126,7 +124,6 @@ class classCacheDiskcache implements interfaceCache
|
||||
/**
|
||||
* Retrieve a value from remote cache store
|
||||
*
|
||||
* @access public
|
||||
* @param string Cache unique key
|
||||
* @return mixed Cached value
|
||||
*/
|
||||
@@ -141,18 +138,18 @@ class classCacheDiskcache implements interfaceCache
|
||||
|
||||
$return_val = "";
|
||||
|
||||
if( file_exists( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php' ) )
|
||||
if( is_file( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php' ) )
|
||||
{
|
||||
require DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php';
|
||||
require DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php';/*noLibHook*/
|
||||
|
||||
$return_val = stripslashes($value);
|
||||
|
||||
if( isset($is_array) AND $is_array == 1 )
|
||||
if( !empty($is_array) )
|
||||
{
|
||||
$return_val = unserialize($return_val);
|
||||
}
|
||||
|
||||
if( isset($ttl) AND $ttl > 0 )
|
||||
if( !empty($ttl) )
|
||||
{
|
||||
if( $mtime = filemtime( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php' ) )
|
||||
{
|
||||
@@ -175,7 +172,6 @@ class classCacheDiskcache implements interfaceCache
|
||||
/**
|
||||
* Update value in remote cache store
|
||||
*
|
||||
* @access public
|
||||
* @param string Cache unique key
|
||||
* @param string Cache value to set
|
||||
* @param integer [Optional] Time to live
|
||||
@@ -194,7 +190,6 @@ class classCacheDiskcache implements interfaceCache
|
||||
/**
|
||||
* Remove a value in the remote cache store
|
||||
*
|
||||
* @access public
|
||||
* @param string Cache unique key
|
||||
* @return boolean Cache removal successful
|
||||
*/
|
||||
@@ -207,7 +202,7 @@ class classCacheDiskcache implements interfaceCache
|
||||
flock( $lock, LOCK_EX );
|
||||
}
|
||||
|
||||
if( file_exists( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php' ) )
|
||||
if( is_file( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php' ) )
|
||||
{
|
||||
@unlink( DOC_IPS_ROOT_PATH . 'cache/' . md5( $this->identifier . $key ) . '.php' );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user