Last modified: 2011-03-25 00:46:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30046, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28046 - Make licenses configurable with LocalSettings.php
Make licenses configurable with LocalSettings.php
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Neil Kandalgaonkar
:
Depends on:
Blocks: 27260
  Show dependency treegraph
 
Reported: 2011-03-14 19:20 UTC by Neil Kandalgaonkar
Modified: 2011-03-25 00:46 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Neil Kandalgaonkar 2011-03-14 19:20:50 UTC
(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().

e.g. 

                $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:

LocalSettings.php:
$wgUploadWizardConfig = array( key => val ... );


Also see bug 26901 because this affects the add-media-wizard case of post-page-load dynamic loading.
Comment 1 Michael Dale 2011-03-24 17:13:29 UTC
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 )
Comment 2 Neil Kandalgaonkar 2011-03-25 00:46:39 UTC
Confirmed, this does work. Thanks Michael!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links