Page MenuHomePhabricator

Avoid evil global hacks in installer with extension registration lookups
Closed, ResolvedPublic

Description

In Installer::includeExtensions():

		require "$IP/includes/DefaultSettings.php";

		foreach ( $exts as $e ) {
			require_once "$IP/extensions/$e/$e.php";
		}

		$hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ?
			$wgHooks['LoadExtensionSchemaUpdates'] : array();

		// Unset everyone else's hooks. Lord knows what someone might be doing
		// in ParserFirstCallInit (see bug 27171)
		$GLOBALS['wgHooks'] = array( 'LoadExtensionSchemaUpdates' => $hooksWeWant );

We can avoid most of the evilness of this code by reading extension.json files.

Event Timeline

Legoktm raised the priority of this task from to Needs Triage.
Legoktm updated the task description. (Show Details)
Legoktm subscribed.

Change 201417 had a related patch set uploaded (by Legoktm):
installer: Read from extension.json if possible

https://gerrit.wikimedia.org/r/201417

Legoktm renamed this task from Replace evil global hacks in installer with extension registration lookups to Avoid evil global hacks in installer with extension registration lookups.Apr 2 2015, 5:52 AM
Legoktm updated the task description. (Show Details)
Legoktm set Security to None.

Change 201417 merged by jenkins-bot:
installer: Read from extension.json if possible

https://gerrit.wikimedia.org/r/201417

Legoktm claimed this task.