From 083fc6dd3be327c091dd1652b7243e7a822efd65 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 22 Jun 2016 23:22:26 +0100 Subject: [PATCH] getCacheInstance() is the canonical way to get a reference to the cache. --- inc/Principal.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/Principal.php b/inc/Principal.php index dbbce240..0cb2f0d2 100644 --- a/inc/Principal.php +++ b/inc/Principal.php @@ -150,7 +150,7 @@ class Principal { throw new Exception('Can only retrieve a Principal by user_no,principal_id,username or email address'); } - $cache = new AwlCache(); + $cache = getCacheInstance(); if ( $use_cache && isset($session->principal_id) ) { switch ( $type ) { case 'user_no': @@ -498,7 +498,7 @@ class Principal { public function unCache() { if ( !isset($this->cacheNs) ) return; - $cache = new AwlCache(); + $cache = getCacheInstance(); $cache->delete($this->cacheNs, null ); } @@ -601,7 +601,7 @@ class Principal { } static public function cacheFlush( $where, $whereparams=array() ) { - $cache = new AwlCache(); + $cache = getCacheInstance(); if ( !$cache->isActive() ) return; $qry = new AwlQuery('SELECT dav_name FROM dav_principal WHERE '.$where, $whereparams ); if ( $qry->Exec('Principal',__FILE__,__LINE__) ) { @@ -612,7 +612,7 @@ class Principal { } static public function cacheDelete( $type, $value ) { - $cache = new AwlCache(); + $cache = getCacheInstance(); if ( !$cache->isActive() ) return; if ( $type == 'username' ) { $value = '/'.$value.'/';