https://bugzilla.wikimedia.org/show_bug.cgi?id=25049

--- Comment #2 from Roan Kattouw <roan.katt...@gmail.com> 2010-09-13 20:11:47 
UTC ---
(In reply to comment #1)
> Something like...
> 
> // Allow extensions to register modules
> wfRunHooks( 'ResourceLoaderBeforeRespond', $context );
> 
Pretty much yeah, except the second parameter is an array of parameters.

> ...inside of ResourceLoader::respond().
Because there are more ResourceLoader:: functions that use registrations, I'd
prefer having a function called by all such entry points that then calls this
hook once and only once.

In practical terms, something like

protected static function getHookRegistrations( $context ) {
    static $done = false;
    wfRunHooks( 'ResourceLoaderRegistrations', array( $context ) );
    $done = true;
}

Then in all functions using the registration data (including respond(), but
also other functions reading from self::$modules), call this function.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to