http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89481
Revision: 89481
Author: maxsem
Date: 2011-06-04 21:56:44 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
Revert r89254:
* It breaks if any extension uses any global except $IP, $wgHooks or
$wgAutoloadClasses. Some unit tests that try updating a virtual database are
already affected.
* If we have LocalSettings.php, we already have it loaded - are there code
paths that don't have it?
* Parsing PHP with regexes is fragile and scary
Modified Paths:
--------------
trunk/phase3/includes/installer/DatabaseUpdater.php
Modified: trunk/phase3/includes/installer/DatabaseUpdater.php
===================================================================
--- trunk/phase3/includes/installer/DatabaseUpdater.php 2011-06-04 21:34:07 UTC
(rev 89480)
+++ trunk/phase3/includes/installer/DatabaseUpdater.php 2011-06-04 21:56:44 UTC
(rev 89481)
@@ -73,7 +73,6 @@
}
$this->maintenance->setDB( $db );
$this->initOldGlobals();
- $this->initIncludedExtensions();
wfRunHooks( 'LoadExtensionSchemaUpdates', array( $this ) );
}
@@ -96,28 +95,6 @@
}
/**
- * Try to include extensions from LocalSettings so their
LocalExtensionSchemaChanges hooks can be run
- */
- private function initIncludedExtensions() {
- global $IP, $wgHooks, $wgAutoloadClasses;
- $ls = file_get_contents( "$IP/LocalSettings.php" );
- if ( $ls === false ) return;
- $matches = array();
- preg_match_all(
'/[[:blank:]]*(?:require|include){1}(?:_once)?[[:blank:]]*\([[:blank:]]*"\$IP\/extensions\/([^\/].*)\/\1\.php"[[:blank:]]*\);[[:blank:]]*/i',
- $ls, $matches, PREG_SET_ORDER );
- unset( $ls );
-
- if ( !isset( $wgHooks ) )
- $wgHooks = array();
- if ( !isset( $wgAutoloadClasses ) )
- $wgAutoloadClasses = array();
-
- foreach ( $matches as $match ) {
- include_once (
"$IP/extensions/{$match[1]}/{$match[1]}.php" );
- }
- }
-
- /**
* @throws MWException
* @param DatabaseBase $db
* @param bool $shared
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs