From 98cd4bbe28b44b388772a53e613fc4f6298dc2dd Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 5 Aug 2014 11:59:06 +0000 Subject: [PATCH] using cache more efficiently; prevent clearing cache on profileChange; hook into clear_cache callable from admin --- mail/inc/class.mail_ui.inc.php | 4 ++-- mail/setup/setup.inc.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index e6d59863b7..789dd469a0 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -123,7 +123,7 @@ class mail_ui } try { - $this->mail_bo = mail_bo::getInstance(true,self::$icServerID); + $this->mail_bo = mail_bo::getInstance(true,self::$icServerID,$_validate=true, $_oldImapServerObject=false, $_reuseCache=true); if (mail_bo::$debug) error_log(__METHOD__.__LINE__.' Fetched IC Server:'.self::$icServerID.'/'.$this->mail_bo->profileID.':'.function_backtrace()); //error_log(__METHOD__.__LINE__.array2string($this->mail_bo->icServer)); @@ -207,7 +207,7 @@ class mail_ui if (mail_bo::$debug) error_log(__METHOD__.__LINE__.'->'.self::$icServerID.'<->'.$_icServerID); if ($unsetCache) emailadmin_imapbase::unsetCachedObjects(self::$icServerID); - $this->mail_bo = mail_bo::getInstance(false,self::$icServerID); + $this->mail_bo = mail_bo::getInstance(false,self::$icServerID,$_validate=true, $_oldImapServerObject=false, $_reuseCache=true); if (mail_bo::$debug) error_log(__METHOD__.__LINE__.' Fetched IC Server:'.self::$icServerID.'/'.$this->mail_bo->profileID.':'.function_backtrace()); // no icServer Object: something failed big time if (!isset($this->mail_bo->icServer) || $this->mail_bo->icServer->ImapServerId<>$_icServerID) diff --git a/mail/setup/setup.inc.php b/mail/setup/setup.inc.php index cebc187d3b..5bf8d231c2 100644 --- a/mail/setup/setup.inc.php +++ b/mail/setup/setup.inc.php @@ -34,6 +34,7 @@ $setup_info['mail']['hooks']['settings'] = 'mail_hooks::settings'; $setup_info['mail']['hooks']['sidebox_menu'] = 'mail_hooks::sidebox_menu'; $setup_info['mail']['hooks']['session_creation'] = 'mail_bo::resetConnectionErrorCache'; $setup_info['mail']['hooks']['verify_settings'] = 'mail_bo::forcePrefReload'; +$setup_info['mail']['hooks']['clear_cache'] = 'mail_bo::unsetCachedObjects'; $setup_info['mail']['hooks']['check_notify'] = 'mail_hooks::notification_check_mailbox'; $setup_info['mail']['hooks']['edit_user'] = 'mail_hooks::edit_user';