User "Awjrichards" changed the status of MediaWiki.r95723.

Old Status: new
New Status: fixme

User "Awjrichards" also posted a comment on MediaWiki.r95723.

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

Preliminary work refactoring the DonationInterface extension.
Most of the exciting things are located in the new globalcollect_gateway 
directory. The .adapter class is eventually meant to inherit the lion's share 
of its functionality from a parent class, leaving only the things specific to 
globalcollect in the .adapter.
That way, we can define new gateways fairly rapidly in the future.

This is only part of the way down that road, and is almost certainly very 
broken. Enjoy.

Comment:

In donationinterface.php:
<pre>
foreach ( $wgDonationInterfaceEnabledGateways as $gateway ) {
        //include 'em
        require_once( $donationinterface_dir . $gateway . '_gateway/' . 
$gateway . '_gateway.php' );
}
</pre>
This should take advantage of the class autoloading in Mediawiki 
($wgAutloadClasses['<class name'>] = '/path/to/class';

As a side note, I feel like the autoloading of the form classes in there can be 
done much more elegantly than it is now, but this is pretty minor.

In gateway.adapter.php:
<pre>
/**
  * Actually do... stuff. Here. 
  * TODO: Better comment. 
  * Process the entire response gott'd by the last four functions. 
  */
</pre>
This is unprecedented meta-irony.

<pre>
        //ALL OF THESE need to be redefined in the children. Much voodoo 
depends on the accuracy of these constants. 
        const gatewayname = 'Donation Gateway';
        const identifier = 'donation';
        const communicationtype = 'xml'; //this needs to be either 'xml' or 
'namevalue'
        const globalprefix = 'wgDonationGateway'; //...for example. 
</pre>
Constants should be all uppercase, with underscores.  

Also:
<pre>
$this->url = self::getGlobal('TestingURL');
</pre>
Should be:
<pre>
$this->url = self::getGlobal( 'TestingURL' );
</pre>
I could go on, but in general, take a look at: 
http://www.mediawiki.org/wiki/Coding_conventions

More to come :)

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

Reply via email to