r54411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54410‎ | r54411 | r54412 >
Date:00:23, 5 August 2009
Author:demon
Status:ok (Comments)
Tags:
Comment:
Make this work by only loading things with a maintClass.
Modified paths:
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/Maintenance.php
@@ -728,8 +728,6 @@
729729 * @return array
730730 */
731731 private static function getCoreScripts() {
732 - return array();
733 - /**
734732 if( !self::$mCoreScripts ) {
735733 self::disableSetup();
736734 $paths = array(
@@ -742,8 +740,11 @@
743741 foreach( $paths as $p ) {
744742 $handle = opendir( $p );
745743 while( ( $file = readdir( $handle ) ) !== false ) {
 744+ if( $file == 'Maintenance.php' )
 745+ continue;
746746 $file = $p . '/' . $file;
747 - if( is_dir( $file ) || !strpos( $file, '.php' ) ) {
 747+ if( is_dir( $file ) || !strpos( $file, '.php' ) ||
 748+ ( strpos( file_get_contents( $file ), '$maintClass' ) === false ) ) {
748749 continue;
749750 }
750751 require( $file );
@@ -756,6 +757,5 @@
757758 }
758759 }
759760 return self::$mCoreScripts;
760 - */
761761 }
762762 }

Comments

#Comment by Brion VIBBER (talk | contribs)   01:41, 5 August 2009

Kinda hacky but should do for now. :)

Status & tagging log