[Templates-cvs] cvs commit: Template2/lib/Template Plugins.pm

cvs@template-toolkit.org cvs@template-toolkit.org


cvs         06/01/30 10:38:29

  Modified:    lib/Template Plugins.pm
  Log:
  * added $PLUGIN_BASE to provide simpler way of defeating Template::Plugin
    being added to the PLUGIN_BASE by default
  
  Revision  Changes    Path
  2.73      +5 -11     Template2/lib/Template/Plugins.pm
  
  Index: Plugins.pm
  ===================================================================
  RCS file: /template-toolkit/Template2/lib/Template/Plugins.pm,v
  retrieving revision 2.72
  retrieving revision 2.73
  diff -u -r2.72 -r2.73
  --- Plugins.pm	2006/01/30 09:57:28	2.72
  +++ Plugins.pm	2006/01/30 10:38:29	2.73
  @@ -18,7 +18,7 @@
   #
   #----------------------------------------------------------------------------
   #
  -# $Id: Plugins.pm,v 2.72 2006/01/30 09:57:28 abw Exp $
  +# $Id: Plugins.pm,v 2.73 2006/01/30 10:38:29 abw Exp $
   #
   #============================================================================
   
  @@ -29,7 +29,7 @@
   use base 'Template::Base';
   use Template::Constants;
   
  -our $VERSION = sprintf("%d.%02d", q$Revision: 2.72 $ =~ /(\d+)\.(\d+)/);
  +our $VERSION = sprintf("%d.%02d", q$Revision: 2.73 $ =~ /(\d+)\.(\d+)/);
   our $DEBUG   = 0 unless defined $DEBUG;
   our $PLUGIN_BASE = 'Template::Plugin';
   our $STD_PLUGINS = {
  @@ -151,15 +151,9 @@
       # update PLUGIN_BASE to an array ref if necessary
       $pbase = [ ] unless defined $pbase;
       $pbase = [ $pbase ] unless ref($pbase) eq 'ARRAY';
  -
  -    # add $params->{ PLUGIN_DEFAULT } or $PLUGIN_BASE (Template::Plugin)
  -    if (exists $params->{ PLUGIN_DEFAULT }) {
  -        push(@$pbase, $params->{ PLUGIN_DEFAULT })
  -            if $params->{ PLUGIN_DEFAULT };
  -    }
  -    else {
  -        push(@$pbase, $PLUGIN_BASE);
  -    }
  +    
  +    # add default plugin base (Template::Plugin) if set
  +    push(@$pbase, $PLUGIN_BASE) if $PLUGIN_BASE;
   
       $self->{ PLUGIN_BASE } = $pbase;
       $self->{ PLUGINS     } = { %$STD_PLUGINS, %$plugins };