https://bugzilla.wikimedia.org/show_bug.cgi?id=37238

       Web browser: ---
             Bug #: 37238
           Summary: Duplicate code in SiteConfiguration
           Product: MediaWiki
           Version: 1.20-git
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to