Follow-up Bug 7387 - Add Template::Toolkit plugin to allow caching of includes
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tue, 19 Feb 2013 01:24:29 +0000 (22:24 -0300)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 7 Mar 2013 15:58:52 +0000 (10:58 -0500)
Fixes tabulations.

Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Koha/Template/Plugin/Cache.pm

index 1bdb665..fb3a76a 100644 (file)
@@ -37,7 +37,7 @@ sub new {
     }
     else {
         require Koha::Cache;
-       $cache = Koha::Cache->new( { 'cache_type' => 'memcached', 'cache_servers' => C4::Context->config('memcached_servers') });
+        $cache = Koha::Cache->new( { 'cache_type' => 'memcached', 'cache_servers' => C4::Context->config('memcached_servers') });
     }
     my $self = bless {
         CACHE   => $cache,
@@ -77,15 +77,14 @@ sub _cached_action {
             ':',
             (
                 $params->{template},
-               map { "$_=$cache_keys->{$_}" } keys %{$cache_keys}
+                map { "$_=$cache_keys->{$_}" } keys %{$cache_keys}
             )
         );
     }
     my $result = $self->{CACHE}->get_from_cache($key);
     if ( !$result ) {
-       warn "here in not in cache";
-       $result = $self->{CONTEXT}->$action( $params->{template} );
-       $self->{CACHE}->set_in_cache( $key, $result, $params->{ttl} );
+        $result = $self->{CONTEXT}->$action( $params->{template} );
+        $self->{CACHE}->set_in_cache( $key, $result, $params->{ttl} );
     }
     return $result;
 }