r36942 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36941‎ | r36942 | r36943 >
Date:19:41, 2 July 2008
Author:demon
Status:old
Tags:
Comment:
Return true on success, not just false on failure. A bit of documentation as well :-)
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/AutoLoader.php
@@ -463,6 +463,14 @@
464464
465465 );
466466
 467+ /**
 468+ * autoload - take a class name and attempt to load it
 469+ *
 470+ * @param string $className Name of class we're looking for.
 471+ * @return bool Returning false is important on failure as
 472+ * it allows Zend to try and look in other registered autoloaders
 473+ * as well.
 474+ */
467475 static function autoload( $className ) {
468476 global $wgAutoloadClasses;
469477
@@ -484,7 +492,7 @@
485493 if ( !$filename ) {
486494 # Give up
487495 wfProfileOut( __METHOD__ );
488 - return;
 496+ return false;
489497 }
490498 }
491499
@@ -495,6 +503,7 @@
496504 }
497505 require( $filename );
498506 wfProfileOut( __METHOD__ );
 507+ return true;
499508 }
500509
501510 static function loadAllExtensions() {

Status & tagging log