From: Uri Guttman Date: Fri, 12 Dec 2008 23:36:20 +0000 (-0500) Subject: added basic compiled templates X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=060b866c8fcd6f0db48be9db01e7e9137ca860cc;p=urisagit%2FTemplate-Simple.git added basic compiled templates need to add loops, tests, benchmarks --- diff --git a/lib/Template/Simple.pm b/lib/Template/Simple.pm index 4906108..1b603d0 100644 --- a/lib/Template/Simple.pm +++ b/lib/Template/Simple.pm @@ -409,9 +409,18 @@ sub delete_templates { my( $self, @names ) = @_ ; +# delete all the cached stuff or just the names passed in + @names = keys %{$self->{tmpl_cache}} unless @names ; +# clear out all the caches +# TODO: reorg these into a hash per name + delete @{$self->{tmpl_cache}}{ @names } ; + delete @{$self->{compiled_cache}}{ @names } ; + delete @{$self->{source_cache}}{ @names } ; + +# also remove where we found it to force a fresh search delete @{$self->{template_paths}}{ @names } ;