Josh wrote:
> Here is my new and
> improved plugins patch with added documentation and tests. I also got rid
> of the IGNORE_STD_PLUGINS config option in the previous patch, as this can
> be overrode already via $Template::Plugins::STD_PLUGINS = {}; (I've made a
> note of that in the documentation.) I think I've added to the documentation
> correctly, but feel free to critique.
Thanks Josh. The documentation and tests are great. Apart from anything
else, they help me understand exactly what it is that your patch is trying
to achieve, and show me how you're expecting it to work.
> =item PLUGINS_USE_LOWERCASE
I think we can safely make this the default behaviour. All the
standard plugins use lower case names, and all the examples show
PLUGINS being specified in lower case. So I've made it standard
behaviour to search for
$PLUGINS->{ $name } || $PLUGINS->{ lc $name }
Instead of just:
$PLUGINS->{ $name }
So for standard plugins and those you add via PLUGINS, you can specify
them in any case and they should always match the lower case equivalent
(if they're defined in lower case, which they always are for standard
plugins).
Note that this doesn't change the behaviour of the PLUGIN_BASE which is
always case sensitive.
> =item ADD_DEFAULT_PLUGIN_BASE
This is also a useful addition that I've been meaning to look at for
ages. However, I think we can streamline it somewhat by defining the
'Template::Plugin' default in a package variable which the user can
override/clear to change the default search path.
$Template::Plugins::PLUGIN_BASE = '';
Now 'Template::Plugin' doesn't get added to the PLUGIN_BASE.
If you don't want any plugins then you need to do this:
$Template::Plugins::STD_PLUGINS = { };
$Template::Plugins::PLUGIN_BASE = '';
Will that do?
Changes, docs and tests are in CVS.
Cheers
A
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates