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 Memcache 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
|
||||
*/
|
||||
@@ -137,19 +137,35 @@ class _Memcache 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 )
|
||||
{
|
||||
if ( in_array( $key, $this->doesNotExist ) )
|
||||
{
|
||||
unset( $this->doesNotExist[ array_search( $key, $this->doesNotExist ) ] );
|
||||
}
|
||||
$this->cache[ $key ] = $value;
|
||||
|
||||
return (bool) $this->link->set( \IPS\SUITE_UNIQUE_KEY . '_' . $key, $value );
|
||||
|
||||
if ( $this->link instanceof \Memcached )
|
||||
{
|
||||
$result = (bool) $this->link->set( \IPS\SUITE_UNIQUE_KEY . '_' . $key, $value, $expire ? $expire->getTimestamp() : 0 );
|
||||
if ( !$result )
|
||||
{
|
||||
$error = $this->link->getResultCode();
|
||||
/** will log the error code returned by memcached; lookup: http://php.net/manual/en/memcached.getresultcode.php */
|
||||
\IPS\Log::debug( 'error code ' . $error, 'memcached_set_error' );
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (bool) $this->link->set( \IPS\SUITE_UNIQUE_KEY . '_' . $key, $value, MEMCACHE_COMPRESSED, $expire ? $expire->getTimestamp() : 0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user