User "^demon" posted a comment on MediaWiki.r90132.

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

adding code for skeleton API

Comment:

You could put them in an array, and then load $wgAutoloadClasses from that. 
Something like
<pre>
// Add new metrics classes here
$myMetrics = ( 'foo', 'bar', 'baz' );

// Initialize classes from metric files
foreach( $myMetrics as $metric ) {
        // Generate classname and filename from $metric. You'll need to enforce 
some naming convention
        $wgAutoloadClasses[$className] = $fileName;
}
</pre>
You'll note there's no need for an include or require. Autoloader does all that 
magic for you once you've given it the classname => path associations.

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

Reply via email to