Last modified: 2014-04-23 17:18:18 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 T39238, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37238 - Duplicate code in SiteConfiguration
Duplicate code in SiteConfiguration
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.20.x
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: ---


Attachments

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()

https://gerrit.wikimedia.org/r/107034
Comment 3 Gerrit Notification Bot 2014-03-19 12:27:37 UTC
Change 107034 abandoned by Hashar:
Removed SiteConfiguration::getAll()

Reason:
Abandoning for now. No follow up since last comments three months ago.

https://gerrit.wikimedia.org/r/107034
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.


Navigation
Links