mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* stop using global $cache variable, use Singleton pattern instead
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Dashboard';
|
||||
|
||||
$cache = Cache::getInstance();
|
||||
if($cache->enabled()) {
|
||||
if(isset($_GET['clear_cache'])) {
|
||||
if(clearCache())
|
||||
@@ -55,7 +56,8 @@ $twig->display('admin.dashboard.html.twig', array(
|
||||
|
||||
function clearCache()
|
||||
{
|
||||
global $cache, $template_name;
|
||||
global $template_name;
|
||||
$cache = Cache::getInstance();
|
||||
|
||||
$tmp = '';
|
||||
if($cache->fetch('status', $tmp))
|
||||
|
@@ -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 = '';
|
||||
|
Reference in New Issue
Block a user