mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Should help with Issue #53 - PHP Strict issues
This commit is contained in:
@@ -1445,7 +1445,7 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
|
||||
// Create the data to be stored
|
||||
if($sql->db_Select_gen("REPLACE INTO `#core` (e107_name,e107_value) values ('SitePrefs', '".$eArrayStorage->WriteArray($_pref)."') "))
|
||||
{
|
||||
ecache::clear_sys('Config_core');
|
||||
ecacXXXhe::clear_sys('Config_core');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@@ -36,8 +36,8 @@ class ecache {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->UserCacheActive = e107::getPref('cachestatus');
|
||||
$this->SystemCacheActive = e107::getPref('syscachestatus');
|
||||
//$this->UserCacheActive = e107::getPref('cachestatus');
|
||||
//$this->SystemCacheActive = e107::getPref('syscachestatus');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,7 @@ class ecache {
|
||||
{
|
||||
if(($ForcedCheck != false ) || ($syscache == false && $this->UserCacheActive) || ($syscache == true && $this->SystemCacheActive) && !e107::getParser()->checkHighlighting())
|
||||
{
|
||||
$cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache));
|
||||
$cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : self::cache_fname($CacheTag, $syscache));
|
||||
if (file_exists($cache_file))
|
||||
{
|
||||
if ($MaximumAge != false && (filemtime($cache_file) + ($MaximumAge * 60)) < time()) {
|
||||
@@ -134,8 +134,9 @@ class ecache {
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @param string $query
|
||||
* @param string $CacheTag
|
||||
* @param int $MaximumAge the time in minutes before the cache file 'expires'
|
||||
* @param boolean $force
|
||||
* @desc Returns the data from the cache file associated with $query, else it returns false if there is no cache for $query.
|
||||
* @scope public
|
||||
*/
|
||||
@@ -147,7 +148,7 @@ class ecache {
|
||||
}
|
||||
else
|
||||
{
|
||||
return ecache::retrieve($CacheTag, $MaximumAge, $ForcedCheck, true);
|
||||
return self::retrieve($CacheTag, $MaximumAge, $ForcedCheck, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +166,7 @@ class ecache {
|
||||
{
|
||||
if(($ForceCache != false ) || ($syscache == false && $this->UserCacheActive) || ($syscache == true && $this->SystemCacheActive) && !e107::getParser()->checkHighlighting())
|
||||
{
|
||||
$cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache));
|
||||
$cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : self::cache_fname($CacheTag, $syscache));
|
||||
@file_put_contents($cache_file, ($bRaw? $Data : self::CACHE_PREFIX.$Data) );
|
||||
@chmod($cache_file, 0755); //Cache should not be world-writeable
|
||||
@touch($cache_file);
|
||||
@@ -189,7 +190,7 @@ class ecache {
|
||||
}
|
||||
else
|
||||
{
|
||||
ecache::set($CacheTag, $Data, $ForceCache, $bRaw, true);
|
||||
self::set($CacheTag, $Data, $ForceCache, $bRaw, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,12 +208,14 @@ class ecache {
|
||||
{
|
||||
$file = ($CacheTag) ? preg_replace("#\W#", "_", $CacheTag)."*.cache.php" : "*.cache.php";
|
||||
e107::getEvent()->triggerAdminEvent('cache_clear', "cachetag=$CacheTag&file=$file&syscache=$syscache");
|
||||
$ret = ecache::delete(e_CACHE_CONTENT, $file, $syscache);
|
||||
$ret = self::delete(e_CACHE_CONTENT, $file, $syscache);
|
||||
|
||||
if($CacheTag && $related) //TODO - too dirty - add it to the $file pattern above
|
||||
{
|
||||
ecache::delete(e_CACHE_CONTENT, 'nq_'.$file, $syscache);
|
||||
ecache::delete(e_CACHE_CONTENT, 'nomd5_'.$file, $syscache);
|
||||
self::delete(e_CACHE_CONTENT, 'nq_'.$file, $syscache);
|
||||
self::delete(e_CACHE_CONTENT, 'nomd5_'.$file, $syscache);
|
||||
//ecache::delete(e_CACHE_CONTENT, 'nq_'.$file, $syscache);
|
||||
//ecache::delete(e_CACHE_CONTENT, 'nomd5_'.$file, $syscache);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
@@ -230,7 +233,8 @@ class ecache {
|
||||
}
|
||||
else
|
||||
{
|
||||
ecache::clear($CacheTag, true, $related);
|
||||
self::clear($CacheTag, true, $related);
|
||||
// ecache::clear($CacheTag, true, $related);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -832,6 +832,12 @@ class e107
|
||||
{
|
||||
e107_require_once(e_HANDLER.'pref_class.php');
|
||||
self::$_core_config_arr[$name] = new e_core_pref($name, $load);
|
||||
|
||||
if($name == 'core') // prevent loop between pref and cache handlers.
|
||||
{
|
||||
e107::getCache()->UserCacheActive = self::getPref('cachestatus');
|
||||
e107::getCache()->SystemCacheActive = self::getPref('syscachestatus');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$_core_config_arr[$name];
|
||||
|
@@ -491,7 +491,7 @@ class e_pref extends e_front_model
|
||||
*
|
||||
* @param boolean $from_post merge post data
|
||||
* @param boolean $force
|
||||
* @param boolean $session_messages use session messages //FIXME Appears to be ignored on "Settings successfully saved.";
|
||||
* @param boolean $session_messages use session messages //FIXME Appears to be ignored on "Settings successfully saved.
|
||||
* @return boolean|integer 0 - no change, true - saved, false - error
|
||||
*/
|
||||
public function save($from_post = true, $force = false, $session_messages = false)
|
||||
@@ -559,7 +559,7 @@ class e_pref extends e_front_model
|
||||
if(e107::getDb()->db_Select_gen("REPLACE INTO `#core` (e107_name,e107_value) values ('".$this->prefid."_Backup', '".addslashes($dbdata)."') "))
|
||||
{
|
||||
if(!$disallow_logs) $admin_log->logMessage('Backup of <strong>'.$this->alias.' ('.$this->prefid.')</strong> successfully created.', E_MESSAGE_DEBUG, E_MESSAGE_SUCCESS, $session_messages);
|
||||
ecache::clear_sys('Config_'.$this->alias.'_backup');
|
||||
e107::getCache()->clear_sys('Config_'.$this->alias.'_backup');
|
||||
}
|
||||
}
|
||||
$this->setPrefCache($this->toString(false), true); //reset pref cache - runtime & file
|
||||
@@ -609,7 +609,7 @@ class e_pref extends e_front_model
|
||||
{
|
||||
if(!$this->pref_cache)
|
||||
{
|
||||
$this->pref_cache = ecache::retrieve_sys('Config_'.$this->alias, 24 * 60, true);
|
||||
$this->pref_cache = e107::getCache()->retrieve_sys('Config_'.$this->alias, 24 * 60, true);
|
||||
}
|
||||
|
||||
return ($toArray && $this->pref_cache ? e107::getArrayStorage()->ReadArray($this->pref_cache) : $this->pref_cache);
|
||||
@@ -636,7 +636,7 @@ class e_pref extends e_front_model
|
||||
}
|
||||
if($save)
|
||||
{
|
||||
ecache::set_sys('Config_'.($save !== true ? $save : $this->alias), $cache_string, true);
|
||||
e107::getCache()->set_sys('Config_'.($save !== true ? $save : $this->alias), $cache_string, true);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@@ -654,7 +654,7 @@ class e_pref extends e_front_model
|
||||
{
|
||||
$this->pref_cache = '';
|
||||
}
|
||||
ecache::clear_sys('Config_'.(!empty($cache_name) ? $cache_name : $this->alias));
|
||||
e107::getCache()->clear_sys('Config_'.(!empty($cache_name) ? $cache_name : $this->alias));
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@@ -1123,7 +1123,7 @@ class themeHandler
|
||||
|
||||
$sql->db_Delete("menus", "menu_layout !='' ");
|
||||
|
||||
ecache::clear_sys();
|
||||
e107::getCache()->clear_sys();
|
||||
|
||||
if($core->save())
|
||||
{
|
||||
|
Reference in New Issue
Block a user