[Phpfreechat-svn] SF.net SVN: phpfreechat: [973] trunk/src/pfcinfo.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-02-20 10:18:57
|
Revision: 973 http://svn.sourceforge.net/phpfreechat/?rev=973&view=rev Author: kerphi Date: 2007-02-20 02:18:56 -0800 (Tue, 20 Feb 2007) Log Message: ----------- [en] Bug fix: the pfcInfo methodes should not print errors when the chat cache could not be found [0h15] [fr] Bug fix : les m?\195?\169thodes de pfcInfo ne doivent pas afficher une erreur lors le cache du chat n'existe pas [0h15] Modified Paths: -------------- trunk/src/pfcinfo.class.php Modified: trunk/src/pfcinfo.class.php =================================================================== --- trunk/src/pfcinfo.class.php 2007-02-20 08:23:37 UTC (rev 972) +++ trunk/src/pfcinfo.class.php 2007-02-20 10:18:56 UTC (rev 973) @@ -20,8 +20,9 @@ { $this->errors[] = _pfc("Error: the cached config file doesn't exists"); return; - } + } // then intitialize the pfcglobalconfig + $params = array(); $params["serverid"] = $serverid; $params["data_private_path"] = $data_private_path; $this->c =& pfcGlobalConfig::Instance($params); @@ -32,8 +33,15 @@ */ function getErrors() { - return array_merge($this->errors, $this->c->getErrors()); + if ($this->c != null) + return array_merge($this->errors, $this->c->getErrors()); + else + return $this->errors; } + function hasErrors() + { + return count($this->getErrors()) > 0; + } /** * @param $channel the returned list is the list of nicknames present on the given channel (NULL for the whole server) @@ -42,6 +50,8 @@ */ function getOnlineNick($channel = NULL, $timeout = 20) { + if ($this->hasErrors()) return array(); + $ct =& pfcContainer::Instance(); if ($channel != NULL) $channel = pfcCommand_join::GetRecipient($channel); @@ -65,6 +75,8 @@ */ function getLastMsg($channel, $nb) { + if ($this->hasErrors()) return array(); + // to be sure the $nb params is a positive number if ( !( $nb >= 0 ) ) $nb = 10; @@ -84,6 +96,8 @@ */ function rehash() { + if ($this->hasErrors()) return false; + $destroyed = $this->c->destroyCache(); return $destroyed; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |