Update Cache-Lite to 1.8.3
Compatibility with PHP 7.4
This commit is contained in:
parent
54efde550e
commit
f7d0e4530c
@ -304,6 +304,16 @@ class Cache_Lite
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 constructor for backwards compatibility with older code
|
||||
*
|
||||
* @param array $options Options
|
||||
*/
|
||||
function Cache_Lite($options = array(NULL))
|
||||
{
|
||||
self::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic way to set a Cache_Lite option
|
||||
*
|
||||
@ -698,8 +708,10 @@ class Cache_Lite
|
||||
$this->_touchCacheFile();
|
||||
$this->_memoryCachingArray[$this->_file] = $data;
|
||||
if ($this->_memoryCachingCounter >= $this->_memoryCachingLimit) {
|
||||
list($key, ) = each($this->_memoryCachingArray);
|
||||
$key = key($this->_memoryCachingArray);
|
||||
next($this->_memoryCachingArray);
|
||||
unset($this->_memoryCachingArray[$key]);
|
||||
|
||||
} else {
|
||||
$this->_memoryCachingCounter = $this->_memoryCachingCounter + 1;
|
||||
}
|
||||
@ -744,7 +756,7 @@ class Cache_Lite
|
||||
if ($this->_fileLocking) @flock($fp, LOCK_SH);
|
||||
clearstatcache();
|
||||
$length = @filesize($this->_file);
|
||||
$mqr = get_magic_quotes_runtime();
|
||||
$mqr = (function_exists('get_magic_quotes_runtime') ? @get_magic_quotes_runtime() : 0);
|
||||
if ($mqr) {
|
||||
set_magic_quotes_runtime(0);
|
||||
}
|
||||
@ -823,7 +835,7 @@ class Cache_Lite
|
||||
if ($this->_readControl) {
|
||||
@fwrite($fp, $this->_hash($data, $this->_readControlType), 32);
|
||||
}
|
||||
$mqr = get_magic_quotes_runtime();
|
||||
$mqr = (function_exists('get_magic_quotes_runtime') ? @get_magic_quotes_runtime() : 0);
|
||||
if ($mqr) {
|
||||
set_magic_quotes_runtime(0);
|
||||
}
|
||||
|
@ -66,6 +66,16 @@ class Cache_Lite_File extends Cache_Lite
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 constructor for backwards compatibility with older code
|
||||
*
|
||||
* @param array $options Options
|
||||
*/
|
||||
function Cache_Lite_File($options = array(NULL))
|
||||
{
|
||||
self::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if a cache is available and (if yes) return it
|
||||
*
|
||||
|
@ -84,7 +84,7 @@ class Cache_Lite_Function extends Cache_Lite
|
||||
function __construct($options = array(NULL))
|
||||
{
|
||||
$availableOptions = array('debugCacheLiteFunction', 'defaultGroup', 'dontCacheWhenTheOutputContainsNOCACHE', 'dontCacheWhenTheResultIsFalse', 'dontCacheWhenTheResultIsNull');
|
||||
while (list($name, $value) = each($options)) {
|
||||
foreach ($options as $name => $value) {
|
||||
if (in_array($name, $availableOptions)) {
|
||||
$property = '_'.$name;
|
||||
$this->$property = $value;
|
||||
@ -94,6 +94,16 @@ class Cache_Lite_Function extends Cache_Lite
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 constructor for backwards compatibility with older code
|
||||
*
|
||||
* @param array $options Options
|
||||
*/
|
||||
function Cache_Lite_Function($options = array(NULL))
|
||||
{
|
||||
self::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls a cacheable function or method (or not if there is already a cache for it)
|
||||
*
|
||||
|
@ -31,6 +31,16 @@ class Cache_Lite_Output extends Cache_Lite
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 constructor for backwards compatibility with older code
|
||||
*
|
||||
* @param array $options Options
|
||||
*/
|
||||
function Cache_Lite_Output($options = array(NULL))
|
||||
{
|
||||
self::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the cache
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user