Last modified: 2014-04-23 17:18:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 37238 - Duplicate code in SiteConfiguration
Duplicate code in SiteConfiguration
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Tina Johnson ( tinaj1234 )
: easy
Depends on:
Blocks: code_quality
  Show dependency treegraph
Reported: 2012-05-31 08:12 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-04-23 17:18 UTC (History)
3 users (show)

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


Description Antoine "hashar" Musso (WMF) 2012-05-31 08:12:24 UTC
The two following methods in SiteConfiguration seems to have duplicate code:

- SiteConfiguration::extractGlobalSetting()
- SiteConfiguration::getAll()

They both check if a variable starts with '+', eventually merge array or just set the value.  The only difference is that the first one write the result in $_GLOBALS;

Considering what we have in production:

 globals = $conf->getAll( 'enwiki' );
 extract( $globals );

That could be replaced by:

 $conf->extractAllGlobals( 'enwiki' );

Actually, since both methods seems to be duplicates, we are not sure the two use cases are going to do EXACTLY the same thing. Hence this request to factor out both methods.
Comment 1 Tina Johnson ( tinaj1234 ) 2014-01-12 12:30:51 UTC
Can I work on this bug?
Comment 2 Gerrit Notification Bot 2014-01-12 14:10:03 UTC
Change 107034 had a related patch set uploaded by Tinaj1234:
Removed SiteConfiguration::getAll()
Comment 3 Gerrit Notification Bot 2014-03-19 12:27:37 UTC
Change 107034 abandoned by Hashar:
Removed SiteConfiguration::getAll()

Abandoning for now. No follow up since last comments three months ago.
Comment 4 Andre Klapper 2014-04-23 17:18:18 UTC
Tina Johnson: This issue has been assigned to you a while ago. 
Could you please provide a status update and inform us whether you are still working (or still plan to work) on this issue? 
Only in case you do not plan to work on this issue anymore, should the assignee be set back to default? Thanks.

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