12 Октябрь 2012 г. 7:23:19 пользователь Victor Vasiliev ([email protected])
написал:
On 10/11/2012 08:33 PM, Tim Starling wrote:
> Then you would have to load a capability map with potentially hundreds
> of entries at registration time, despite the fact that on most
> requests, most of the hooks will never be called. It seems inefficient
> to me. At least with the current system, the number of support
> constants is small (4-5).
>
> -- Tim Starling
We can cache them. If we use APC, an individual call to
Capabilities::has() should take about 5 to 6 μs.
Shouldn't class_exists( 'ResourceLoader' ) or class_exists( 'ContentHandler' )
be enough for most of tasks?
One even can use Reflection to check for particular changes of mentioned
classes introduced in newer versions.
Of course the compatibility to something really old (let's say 1.14) is not
desired.
Dmitriy
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l