Well part of it is offloading the time. Yes it will be loaded at some point, but it's always nice if that point is after MW has loaded a fair bit of itself.
Whatever the case... It's kinda a compromise for me... Really, I would like to put everything in the class and screw the classic loading files. And I mean config with that... WikiVid::$cAutoload = false; Does send a fair bit more of a signal of "This extension owns this configuration option" than $egWikiVidAutoload does.
And alluding to one of my other messages: $wgLoadExtensions['WikiVid'] = array( 'Autoload' => false );
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
MinuteElectron wrote:
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.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l