Page MenuHomePhabricator

Make licenses configurable with LocalSettings.php
Closed, ResolvedPublic


Author: neilk

(This isn't a new bug, it's been in the back of my mind for a while... just committing to bugzilla)

Currently we glean config from LocalSettings (for some overall behaviour) and more config from UploadWizardPage.js (such as layout constants, available licenses).

We need to pull this stuff from LocalSettings.php instead.

mdale has a nice system for this in MwEmbed, where default settings can be loaded from a well known PHP file, and possibly overridden by LocalSettings.php. The config.php uses a bare return array(... ) so the value of the entire config array is returned by include().


$configPath =  $fullResourcePath . '/' . $moduleName . '.config.php';
if( is_file( $configPath ) ){
        self::$moduleConfig = array_merge( self::$moduleConfig, include( $configPath ) );

However, this means he writes a sort of config system on top of mediawiki's global-oriented config system... we can be less disruptive with something like this:

$wgUploadWizardConfig = array( key => val ... );

Also see bug 26901 because this affects the add-media-wizard case of post-page-load dynamic loading.

Version: unspecified
Severity: enhancement



Related Objects


Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:33 PM
bzimport added a project: UploadWizard.
bzimport set Reference to bz28046.

mdale wrote:

The nice thing about the config file type system is that default configuration is cleanly separated from the LocalSettings.php user configuration.

This was added for upload wizard in r83974 ( marked bug resolved )

neilk wrote:

Confirmed, this does work. Thanks Michael!