Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief XCache Cache Class
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @since 17 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -43,11 +43,11 @@ class _Xcache extends \IPS\Data\Cache
|
||||
{
|
||||
if( isset( $this->cache[ $key ] ) )
|
||||
{
|
||||
\IPS\Log::i( LOG_DEBUG )->setIpAddress( $_SERVER['REMOTE_ADDR'] )->write( "Get {$key} from Xcache (already loaded)", 'cache' );
|
||||
\IPS\Log::debug( "Get {$key} from Xcache (already loaded)", 'cache' );
|
||||
return $this->cache[ $key ];
|
||||
}
|
||||
|
||||
\IPS\Log::i( LOG_DEBUG )->setIpAddress( $_SERVER['REMOTE_ADDR'] )->write( "Get {$key} from Xcache", 'cache' );
|
||||
\IPS\Log::debug( "Get {$key} from Xcache", 'cache' );
|
||||
|
||||
$this->cache[ $key ] = xcache_get( \IPS\SUITE_UNIQUE_KEY . '_' . $key );
|
||||
return $this->cache[ $key ];
|
||||
@@ -56,14 +56,15 @@ class _Xcache extends \IPS\Data\Cache
|
||||
/**
|
||||
* Abstract Method: Set
|
||||
*
|
||||
* @param string $key Key
|
||||
* @param string $value Value
|
||||
* @param string $key Key
|
||||
* @param string $value Value
|
||||
* @para, \IPS\DateTime $expire Expreation time, or NULL for no expiration
|
||||
* @return bool
|
||||
*/
|
||||
protected function set( $key, $value )
|
||||
protected function set( $key, $value, \IPS\DateTime $expire = NULL )
|
||||
{
|
||||
\IPS\Log::i( LOG_DEBUG )->setIpAddress( $_SERVER['REMOTE_ADDR'] )->write( "Set {$key} in Xcache", 'cache' );
|
||||
return (bool) xcache_set( \IPS\SUITE_UNIQUE_KEY . '_' . $key, $value );
|
||||
\IPS\Log::debug( "Set {$key} in Xcache", 'cache' );
|
||||
return (bool) xcache_set( \IPS\SUITE_UNIQUE_KEY . '_' . $key, $value, $expire ? ( $expire->getTimestamp() - time() ) : 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,11 +77,11 @@ class _Xcache extends \IPS\Data\Cache
|
||||
{
|
||||
if( isset( $this->cache[ $key ] ) )
|
||||
{
|
||||
\IPS\Log::i( LOG_DEBUG )->setIpAddress( $_SERVER['REMOTE_ADDR'] )->write( "Check exists {$key} from Xcache (already loaded)", 'cache' );
|
||||
return TRUE;
|
||||
\IPS\Log::debug( "Check exists {$key} from Xcache (already loaded)", 'cache' );
|
||||
return ( $this->cache[ $key ] === FALSE OR $this->cache[ $key ] === NULL ) ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
\IPS\Log::i( LOG_DEBUG )->setIpAddress( $_SERVER['REMOTE_ADDR'] )->write( "Check exists {$key} from Xcache", 'cache' );
|
||||
\IPS\Log::debug( "Check exists {$key} from Xcache", 'cache' );
|
||||
return xcache_isset( \IPS\SUITE_UNIQUE_KEY . '_' . $key );
|
||||
}
|
||||
|
||||
@@ -92,7 +93,7 @@ class _Xcache extends \IPS\Data\Cache
|
||||
*/
|
||||
protected function delete( $key )
|
||||
{
|
||||
\IPS\Log::i( LOG_DEBUG )->setIpAddress( $_SERVER['REMOTE_ADDR'] )->write( "Delete {$key} from Xcache", 'cache' );
|
||||
\IPS\Log::debug( "Delete {$key} from Xcache", 'cache' );
|
||||
return (bool) xcache_unset( \IPS\SUITE_UNIQUE_KEY . '_' . $key );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user