-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Bryan Tong Minh wrote:
The problem currently is that in case you have your own special page overriding SpecialPage::execute, you have to do all setHeaders() and similar calls yourself, as well as the hooks. This basically means that your are copying code from the parent, which sucks and also is not futureproof in case somebody decides to add more magic to SpecialPage::execute.
Perhaps it would be better to fix the setHeaders() issue, so it's called prior to execute()?
More generally, just slapping in a replacement for the entire execute() method sounds like a bad idea. If you're extending a base class, you probably want to *alter* its behavior, not replace it. The right way to do this is to factor the code sensibly in the first place, so you only have to replace the relevant parts instead of reimplenting the whole execute() method.
Adding a generic run() method doesn't help you there -- it saves you one line of boilerplate and makes you redo everything else.
- -- brion