User "Awjrichards" posted a comment on MediaWiki.r96927.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96927#c23473
Commit summary:

Mods to make the DonationInterface tests accurate again.Fundraiser Card #285
Modifications to DonationInterface so RapidHTML works in a gateway-agnostic 
sort of way.
Also, some clean up: followup r95723, and mods to the tests.

Comment:

>From donationinterface.php:
<pre>
//This is going to be a little funky. 
//Override this in LocalSettings.php BEFORE you include this file, if you want 
//to disable gateways.
//TODO: Unfunktify, if you have a better idea here for auto-loading the classes 
after LocalSettings.php runs all the way. 
if ( !isset( $wgDonationInterfaceEnabledGateways ) ) {
        $wgDonationInterfaceEnabledGateways = array(
                'paypal',
                'payflowpro',
                'globalcollect'
        );
}

foreach ( $wgDonationInterfaceEnabledGateways as $gateway ) {
        //include 'em
        require_once( $donationinterface_dir . $gateway . '_gateway/' . 
$gateway . '_gateway.php' );
}
</pre>
You can just get rid of:
<pre>
if( !isset( $wgDonationInterfaceEnabledGateways ))
</pre>
Typically with Mediawiki, if a user wanted to override default enabled 
gateways, they would do so by re-declaring the 
$wgDonationInterfaceEnabledGateways variable after the inclusion of the install 
file.  You can then move the foreach() portion into a deferred setup function 
(see 
http://www.mediawiki.org/wiki/Manual:Developing_extensions#Deferring_setup).  
Also, it's nicer to use $wgAutoloadClasses rather than the require_once for 
each of the gateway files.



_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to