silence warnings about missing or not set folderInfo in folderExists

This commit is contained in:
Klaus Leithoff 2011-12-14 13:10:25 +00:00
parent c81b1b0cfa
commit 475307d17b

View File

@ -3380,11 +3380,11 @@ class felamimail_bo
// reduce traffic within the Instance per User; Expire every 5 Minutes
//error_log(__METHOD__.__LINE__.' Called with Folder:'.$_folder.function_backtrace());
if (is_null($folderInfo)) $folderInfo = egw_cache::getCache(egw_cache::INSTANCE,'email','icServerFolderExistsInfo'.trim($GLOBALS['egw_info']['user']['account_id']),null,array(),$expiration=60*5);
if (isset($folderInfo[$this->profileID][$_folder]) && $forceCheck===false) return $folderInfo[$this->profileID][$_folder];
if (!empty($folderInfo) && isset($folderInfo[$this->profileID][$_folder]) && $forceCheck===false) return $folderInfo[$this->profileID][$_folder];
// does the folder exist???
//error_log(__METHOD__."->Connected?".$this->icServer->_connected.", ".$_folder.", ".($forceCheck?' forceCheck activated':'dont check on server'));
if ((!($this->icServer->_connected == 1)) && $forceCheck || !isset($folderInfo[$this->profileID][$_folder])) {
if ((!($this->icServer->_connected == 1)) && $forceCheck || empty($folderInfo) || !isset($folderInfo[$this->profileID][$_folder])) {
//error_log(__METHOD__."->NotConnected and forceCheck with profile:".$this->profileID);
//return false;
//try to connect
@ -3393,12 +3393,13 @@ class felamimail_bo
if(($this->icServer instanceof defaultimap)) $folderInfo[$this->profileID][$_folder] = $this->icServer->mailboxExist($_folder);
//error_log(__METHOD__.__LINE__.' Folder Exists:'.$folderInfo[$this->profileID][$_folder].function_backtrace());
if(($folderInfo[$this->profileID][$_folder] instanceof PEAR_Error) || $folderInfo[$this->profileID][$_folder] !== true)
if(!empty($folderInfo) && isset($folderInfo[$this->profileID][$_folder]) &&
($folderInfo[$this->profileID][$_folder] instanceof PEAR_Error) || $folderInfo[$this->profileID][$_folder] !== true)
{
$folderInfo[$this->profileID][$_folder] = false; // set to false, whatever it was (to have a valid returnvalue for the static return)
}
egw_cache::setCache(egw_cache::INSTANCE,'email','icServerFolderExistsInfo'.trim($GLOBALS['egw_info']['user']['account_id']),$folderInfo,$expiration=60*5);
return $folderInfo[$this->profileID][$_folder];
return (!empty($folderInfo) && isset($folderInfo[$this->profileID][$_folder]) ? $folderInfo[$this->profileID][$_folder] : false);
}
/**