DanTMan wrote:
Tim Starling wrote:
Loading large amounts of code is slow and memory hungry, especially on installations without an opcode cache. So lazy-load your code, by putting everything into autoloaded classes. Use static member functions for hooks.
^_^ I've been creating classes with the name of my extension for awhile and putting all the hooks and extension functions into them and autoloading the class for awhile now. Heh, I just did it because it looked cleaner than using ugly efExtName functions, didn't know it was a design basic.
Of course, this loads the entire class -- even anything you might not need at that time; any extension functions you want in $wgExtensionFunctions could just be put in the global scope anyway since they are always going to be loaded regardless of what code path is chosen.
MinuteElectron.