Hey,

> One way would to specify a callback. For PHP 5.3 and later we can use
closures...

That would work yes! :) I've been doing something very similar for various
hooks lately, and it works great.

$this->hooks['ParserFirstCallInit'][] = function( Parser &$parser ) use (
> $extension ) {
>
    $hookRegistrant = $extension->getHookRegistrant( $parser );
>
    $countHandler = $extension->getCountFunctionHandler();
>
    $hookRegistrant->registerFunction( $countHandler );
>

>     return true;
> };
>

Where $extension is a very basic DIC.

Anyone objections, concerns or further thoughts on Brion's suggestion?

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to