* stop using global $cache variable, use Singleton pattern instead

This commit is contained in:
slawkens
2018-06-03 17:09:21 +02:00
parent 45a387000d
commit fb1b9fea09
10 changed files with 99 additions and 61 deletions

View File

@@ -97,6 +97,8 @@ if(isset($_GET['archive']))
header('X-XSS-Protection: 0');
$title = 'Latest News';
$cache = Cache::getInstance();
$news_cached = false;
// some constants, used mainly by database (cannot by modified without schema changes)
define('TITLE_LIMIT', 100);
@@ -441,7 +443,9 @@ class News
static public function getCached($type)
{
global $cache, $template_name;
global $template_name;
$cache = Cache::getInstance();
if($cache->enabled())
{
$tmp = '';