Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+3 -3
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -29,7 +29,7 @@ class _Apc extends \IPS\Data\Cache
*/
public static function supported()
{
return function_exists('apcu_fetch');
return \function_exists('apcu_fetch');
}
/**
@@ -57,7 +57,7 @@ class _Apc extends \IPS\Data\Cache
*
* @param string $key Key
* @param string $value Value
* @para, \IPS\DateTime $expire Expreation time, or NULL for no expiration
* @param \IPS\DateTime|NULL $expire Expreation time, or NULL for no expiration
* @return bool
*/
protected function set( $key, $value, \IPS\DateTime $expire = NULL )
+1 -1
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
+5 -5
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -100,7 +100,7 @@ class _Memcache extends \IPS\Data\Cache
/* Connect and add the servers that are defined to the pool */
$this->link = $this->_getLink();
$configuration['servers'] = ( !is_array( $configuration['servers'] ) ) ? array( $configuration['servers'] ) : $configuration['servers'];
$configuration['servers'] = ( !\is_array( $configuration['servers'] ) ) ? array( $configuration['servers'] ) : $configuration['servers'];
foreach( $configuration['servers'] as $server )
{
@@ -143,12 +143,12 @@ class _Memcache extends \IPS\Data\Cache
*
* @param string $key Key
* @param string $value Value
* @para, \IPS\DateTime $expire Expreation time, or NULL for no expiration
* @param \IPS\DateTime|NULL $expire Expreation time, or NULL for no expiration
* @return bool
*/
protected function set( $key, $value, \IPS\DateTime $expire = NULL )
{
if ( in_array( $key, $this->doesNotExist ) )
if ( \in_array( $key, $this->doesNotExist ) )
{
unset( $this->doesNotExist[ array_search( $key, $this->doesNotExist ) ] );
}
@@ -180,7 +180,7 @@ class _Memcache extends \IPS\Data\Cache
*/
protected function exists( $key )
{
if ( in_array( $key, $this->doesNotExist ) )
if ( \in_array( $key, $this->doesNotExist ) )
{
return FALSE;
}
+1 -1
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
+8 -18
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -25,7 +25,8 @@ class _Redis extends \IPS\Data\Cache
/**
* Constructor
*
* @return void
* @param array $configuration Configuration to use
* @return void
*/
public function __construct( $configuration )
{
@@ -79,15 +80,15 @@ class _Redis extends \IPS\Data\Cache
{
throw new \DomainException( 'datastore_redis_servers_err' );
}
} ),
}, NULL, NULL, 'redis_host' ),
'port' => new \IPS\Helpers\Form\Number( 'server_port', isset( $configuration['port'] ) ? $configuration['port'] : NULL, FALSE, array( 'placeholder' => '6379' ), function( $val )
{
if ( \IPS\Request::i()->cache_method === 'Redis' AND $val AND ( $val < 0 OR $val > 65535 ) )
{
throw new \DomainException( 'datastore_redis_servers_err' );
}
} ),
'password' => new \IPS\Helpers\Form\Password( 'server_password', isset( $configuration['password'] ) ? $configuration['password'] : '', FALSE ),
}, NULL, NULL, 'redis_port' ),
'password' => new \IPS\Helpers\Form\Password( 'server_password', isset( $configuration['password'] ) ? $configuration['password'] : '', FALSE, array(), NULL, NULL, NULL, 'redis_password' ),
);
}
@@ -99,7 +100,6 @@ class _Redis extends \IPS\Data\Cache
/**
* Get random string used in the keys to identify this site compared to other sites
*
* @param string $key
* @return string|FALSE Value from the _datastore; FALSE if key doesn't exist
*/
protected function _getRedisKey()
@@ -148,7 +148,7 @@ class _Redis extends \IPS\Data\Cache
*
* @param string $key Key
* @param string $value Value
* @param \IPS\DateTime $expire Expreation time, or NULL for no expiration
* @param \IPS\DateTime|NULL $expire Expreation time, or NULL for no expiration
* @return bool
*/
protected function set( $key, $value, \IPS\DateTime $expire = NULL )
@@ -200,7 +200,7 @@ class _Redis extends \IPS\Data\Cache
{
try
{
return (bool) \IPS\Redis::i()->delete( $this->_getRedisKey() . '_' . $key );
return (bool) \IPS\Redis::i()->del( $this->_getRedisKey() . '_' . $key );
}
catch( \RedisException $e )
{
@@ -222,14 +222,4 @@ class _Redis extends \IPS\Data\Cache
\IPS\Redis::i()->setex( 'redisKey', 604800, $this->_redisKey );
}
/**
* Log a page hit
*
* @param \IPS\Http\Url|NULL $url URL to log (or null)
* @return void
*/
public function logPageHit( $url=NULL )
{
return \IPS\Redis::i()->logPageHit( $url );
}
}
+2 -2
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -75,7 +75,7 @@ class _Test extends \IPS\Data\Cache
*
* @param string $key Key
* @param string $value Value
* @para, \IPS\DateTime $expire Expreation time, or NULL for no expiration
* @param \IPS\DateTime|NULL $expire Expreation time, or NULL for no expiration
* @return bool
*/
protected function set( $key, $value, \IPS\DateTime $expire = NULL )
+3 -3
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -29,7 +29,7 @@ class _Wincache extends \IPS\Data\Cache
*/
public static function supported()
{
return function_exists('wincache_ucache_get');
return \function_exists('wincache_ucache_get');
}
/**
@@ -57,7 +57,7 @@ class _Wincache extends \IPS\Data\Cache
*
* @param string $key Key
* @param string $value Value
* @para, \IPS\DateTime $expire Expreation time, or NULL for no expiration
* @param \IPS\DateTime|NULL $expire Expreation time, or NULL for no expiration
* @return bool
*/
protected function set( $key, $value, \IPS\DateTime $expire = NULL )
+3 -3
View File
@@ -11,7 +11,7 @@
namespace IPS\Data\Cache;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -29,7 +29,7 @@ class _Xcache extends \IPS\Data\Cache
*/
public static function supported()
{
return function_exists('xcache_get');
return \function_exists('xcache_get');
}
/**
@@ -57,7 +57,7 @@ class _Xcache extends \IPS\Data\Cache
*
* @param string $key Key
* @param string $value Value
* @para, \IPS\DateTime $expire Expreation time, or NULL for no expiration
* @param \IPS\DateTime|NULL $expire Expreation time, or NULL for no expiration
* @return bool
*/
protected function set( $key, $value, \IPS\DateTime $expire = NULL )