Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -56,10 +56,10 @@ abstract class _AbstractData
|
||||
{
|
||||
if( $this->exists( $key ) )
|
||||
{
|
||||
$value = json_decode( $this->get( $key ), TRUE );
|
||||
$value = $this->decode( $this->get( $key ) );
|
||||
if ( \IPS\CACHING_LOG )
|
||||
{
|
||||
$this->log[] = array( 'get', $key, version_compare( PHP_VERSION, '5.4.0' ) >= 0 ? json_encode( $value, JSON_PRETTY_PRINT ) : json_encode( $value ), var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
$this->log[ sprintf( '%.4f', microtime(true) ) ] = array( 'get', $key, version_compare( PHP_VERSION, '5.4.0' ) >= 0 ? json_encode( $value, JSON_PRETTY_PRINT ) : json_encode( $value ), var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
}
|
||||
$this->_data[ $key ] = $value;
|
||||
}
|
||||
@@ -83,10 +83,10 @@ abstract class _AbstractData
|
||||
{
|
||||
if ( \IPS\CACHING_LOG )
|
||||
{
|
||||
$this->log[] = array( 'set', $key, version_compare( PHP_VERSION, '5.4.0' ) >= 0 ? json_encode( $value, JSON_PRETTY_PRINT ) : json_encode( $value ), var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
$this->log[ sprintf( '%.4f', microtime(true) ) ] = array( 'set', $key, version_compare( PHP_VERSION, '5.4.0' ) >= 0 ? json_encode( $value, JSON_PRETTY_PRINT ) : json_encode( $value ), var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
}
|
||||
|
||||
if ( $this->set( $key, json_encode( $value ) ) )
|
||||
if ( $this->set( $key, $this->encode( $value ) ) )
|
||||
{
|
||||
$this->_data[ $key ] = $value;
|
||||
$this->_exists[ $key ] = $key;
|
||||
@@ -117,7 +117,7 @@ abstract class _AbstractData
|
||||
*/
|
||||
public function __isset( $key )
|
||||
{
|
||||
if( isset( $this->_data[ $key ] ) or in_array( $key, $this->_exists ) )
|
||||
if( array_key_exists( $key, $this->_data ) or array_key_exists( $key, $this->_exists ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ abstract class _AbstractData
|
||||
}
|
||||
if ( \IPS\CACHING_LOG )
|
||||
{
|
||||
$this->log[] = array( 'check', $key, var_export( $return, TRUE ), var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
$this->log[ sprintf( '%.4f', microtime(true) ) ] = array( 'check', $key, var_export( $return, TRUE ), var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -146,10 +146,32 @@ abstract class _AbstractData
|
||||
{
|
||||
if ( \IPS\CACHING_LOG )
|
||||
{
|
||||
$this->log[] = array( 'delete', $key, NULL, var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
$this->log[ sprintf( '%.4f', microtime(true) ) ] = array( 'delete', $key, NULL, var_export( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) );
|
||||
}
|
||||
$this->delete( $key );
|
||||
unset( $this->_data[ $key ] );
|
||||
unset( $this->_exists[ $key ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode
|
||||
*
|
||||
* @param mixed $value Value
|
||||
* @return string
|
||||
*/
|
||||
protected function encode( $value )
|
||||
{
|
||||
return json_encode( $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode
|
||||
*
|
||||
* @param mixed $value Value
|
||||
* @return mixed
|
||||
*/
|
||||
protected function decode( $value )
|
||||
{
|
||||
return json_decode( $value, TRUE );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user