On Jan 14, 2005, at 4:36 PM, Andrew Miller wrote:
+# The whitelist +$wgWhitelistRead = array("Special:Userlogin");
Since this causes any installed wiki to fail to be accessible, I've taken it out.
if ($dbr == null)
return;
As a general rule, you should use is_null() rather than == null, as the == operator is relatively 'weak' and will allow equality between for instance null and 0, "", and false.
function reportConnectionError( &$conn ) {
global $wgUseDatabaseMessages; $fname = 'LoadBalancer::reportConnectionError'; wfProfileIn( $fname );
if (!$wgUseDatabaseMessages)
return;
I don't understand the purpose of this. $wgUseDatabaseMessages controls whether user interface messages (generally retrieved via wfMsg() or wfMsgForContent() functions) are to be pulled from the MediaWiki: page entries in the database, or directly from the arrays defined in the language files.
Pulling messages from the default arrays should not prevent the reporting of database errors.
Additionally, as a general rule if you return from a profiled function you should remember to do a wfProfileOut( $fname ) to avoid unbalancing the call tree.
/** Get rights */ $anong = Group::newFromId($wgAnonGroupId); if (!$anong)
wfDebugDieBacktrace("Please update your database
schema "
."and populate initial group data from "
."maintenance/archives patches");
{
if ($wgUseDatabaseMessages)
wfDebugDieBacktrace(
"Please update your database ".
"schema and populate initial ".
"group data from maintenance/".
"archives patches");
return;
This is another really weird bit. Loading UI messages from the hardcoded arrays should definitely not cause a database error to be ignored.
Note also that wfDebugDieBacktrace() causes script execution to end, so a return statement after it can never be reached.
-- brion vibber (brion @ pobox.com)