-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I previously emailed this mailing list ( http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/21070 ) asking about uploading big files. The single I response I recieved was not sufficient... Commonist did not support non-Wikimedia projects, so I set off to create my own special page extension to MediaWiki.
I have completed it, but there are a few hairy bugs pertaining to MediaWiki that I need to sort out. And, perhaps, a friendlier API for UploadForm.
It was a tricky problem: I wanted to keep code duplication down to a minimum, but I had to use a class that was not designed to be extended and have different functionality: it was a very procedural/transaction script style class. I ended up extending it, overloading the constructor, and supplying all the information that the constructor previously determined from the reqest.
So... my hairy bug:
When an image upload is successful, wgOut gets this idea that we should redirect to the image page. This is a bad idea for multiple uploads for obvious reasons. However, I have not been able to isolate the source of the call: a trace to the point where the header is called reveals that wgOut buffers output.
I have overloaded these functions: mainUploadForm(), uploadError() and showSuccess(), so they are probably not sending the redirect, but it persists. I finally solved the issue by, after executing all the forms, setting the redirect back to '', which is hackish.
Also, $wgMessageCache-> seems to be malfunctioning inexplicably for certain messages. Some of them are instantiated, some aren't. Are there any caveats to the function?
My main beef, however, is the way my subclass blatantly ignores all the private recommendations and overloads them. Are they used in the sense of being protected? Since I'm not following the rules, my extension is a hack, albeit an elegant one that doesn't touch the original code and minimalizes duplication. I'd volunteer to refactor SpecialUpload.php: it's a fairly isolated piece of code, and splitting up the code into more functions will make custom upload extensions much easier to write.
I also have to publish the extension. So... what do you think?
- -- Edward Z. Yang Personal: edwardzyang@thewritingpot.com SN:Ambush Commander Website: http://www.thewritingpot.com/ GPGKey:0x869C48DA http://www.thewritingpot.com/gpgpubkey.asc 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA
wikitech-l@lists.wikimedia.org