mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Cache handler: parse error temporary fix (unkown method), reporduce: try static call ecache::retrieve() inside another object Better fix is required, new methods maybe, PHP in strict mod is throwing warnings (non-static method should not be called statically, assuming $this from incompatible context).
This commit is contained in:
@@ -12,22 +12,22 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/cache_handler.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/cache_handler.php,v $
|
||||||
| $Revision: 1.11 $
|
| $Revision: 1.12 $
|
||||||
| $Date: 2009-02-01 16:18:08 $
|
| $Date: 2009-08-03 18:21:46 $
|
||||||
| $Author: e107steved $
|
| $Author: secretr $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
define('CACHE_PREFIX','<?phpexit;');
|
define('CACHE_PREFIX','<?php exit;');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to cache data as files, improving site speed and throughput.
|
* Class to cache data as files, improving site speed and throughput.
|
||||||
*
|
*
|
||||||
* @package e107
|
* @package e107
|
||||||
* @version $Revision: 1.11 $
|
* @version $Revision: 1.12 $
|
||||||
* @author $Author: e107steved $
|
* @author $Author: secretr $
|
||||||
*/
|
*/
|
||||||
class ecache {
|
class ecache {
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class ecache {
|
|||||||
// Add 'nomd5' to indicate we are not calculating an md5
|
// Add 'nomd5' to indicate we are not calculating an md5
|
||||||
$CheckTag = '_nomd5';
|
$CheckTag = '_nomd5';
|
||||||
}
|
}
|
||||||
elseif (isset($this))
|
elseif (isset($this) && $this instanceof ecache)
|
||||||
{
|
{
|
||||||
if (defined("THEME"))
|
if (defined("THEME"))
|
||||||
{
|
{
|
||||||
@@ -110,7 +110,7 @@ class ecache {
|
|||||||
global $pref, $tp;
|
global $pref, $tp;
|
||||||
if(($ForcedCheck != false ) || ($syscache == false && varsettrue($pref['cachestatus'])) || ($syscache == true && varsettrue($pref['syscachestatus'])) && !$tp->checkHighlighting())
|
if(($ForcedCheck != false ) || ($syscache == false && varsettrue($pref['cachestatus'])) || ($syscache == true && varsettrue($pref['syscachestatus'])) && !$tp->checkHighlighting())
|
||||||
{
|
{
|
||||||
$cache_file = (isset($this) ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache));
|
$cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache));
|
||||||
if (file_exists($cache_file))
|
if (file_exists($cache_file))
|
||||||
{
|
{
|
||||||
if ($MaximumAge != false && (filemtime($cache_file) + ($MaximumAge * 60)) < time()) {
|
if ($MaximumAge != false && (filemtime($cache_file) + ($MaximumAge * 60)) < time()) {
|
||||||
@@ -146,7 +146,7 @@ class ecache {
|
|||||||
*/
|
*/
|
||||||
function retrieve_sys($CacheTag, $MaximumAge = false, $ForcedCheck = false)
|
function retrieve_sys($CacheTag, $MaximumAge = false, $ForcedCheck = false)
|
||||||
{
|
{
|
||||||
if(isset($this))
|
if(isset($this) && $this instanceof ecache)
|
||||||
{
|
{
|
||||||
return $this->retrieve($CacheTag, $MaximumAge, $ForcedCheck, true);
|
return $this->retrieve($CacheTag, $MaximumAge, $ForcedCheck, true);
|
||||||
}
|
}
|
||||||
@@ -171,7 +171,7 @@ class ecache {
|
|||||||
global $pref, $FILES_DIRECTORY, $tp;
|
global $pref, $FILES_DIRECTORY, $tp;
|
||||||
if(($ForceCache != false ) || ($syscache == false && varsettrue($pref['cachestatus'])) || ($syscache == true && varsettrue($pref['syscachestatus'])) && !$tp->checkHighlighting())
|
if(($ForceCache != false ) || ($syscache == false && varsettrue($pref['cachestatus'])) || ($syscache == true && varsettrue($pref['syscachestatus'])) && !$tp->checkHighlighting())
|
||||||
{
|
{
|
||||||
$cache_file = (isset($this) ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache));
|
$cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache));
|
||||||
file_put_contents($cache_file, ($bRaw? $Data : CACHE_PREFIX.$Data) );
|
file_put_contents($cache_file, ($bRaw? $Data : CACHE_PREFIX.$Data) );
|
||||||
@chmod($cache_file, 0755); //Cache should not be world-writeable
|
@chmod($cache_file, 0755); //Cache should not be world-writeable
|
||||||
@touch($cache_file);
|
@touch($cache_file);
|
||||||
@@ -189,7 +189,7 @@ class ecache {
|
|||||||
*/
|
*/
|
||||||
function set_sys($CacheTag, $Data, $ForceCache = false, $bRaw=0)
|
function set_sys($CacheTag, $Data, $ForceCache = false, $bRaw=0)
|
||||||
{
|
{
|
||||||
if(isset($this))
|
if(isset($this) && $this instanceof ecache)
|
||||||
{
|
{
|
||||||
return $this->set($CacheTag, $Data, $ForceCache, $bRaw, true);
|
return $this->set($CacheTag, $Data, $ForceCache, $bRaw, true);
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ class ecache {
|
|||||||
*/
|
*/
|
||||||
function clear_sys($CacheTag = '')
|
function clear_sys($CacheTag = '')
|
||||||
{
|
{
|
||||||
if(isset($this))
|
if(isset($this) && $this instanceof ecache)
|
||||||
{
|
{
|
||||||
return $this->clear($CacheTag, true);
|
return $this->clear($CacheTag, true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user