From 08388ac8eaff0dbecfe5aded36e8cf297466cd57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 27 Jan 2010 15:03:27 +0100 Subject: [PATCH] Template Caching --- SL/Form.pm | 15 +++------------ config/lx-erp.conf | 4 ++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index b0e25d70d..468f6dc27 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -841,23 +841,14 @@ sub parse_html_template { 'CACHE_SIZE' => 0, 'PLUGIN_BASE' => 'SL::Template::Plugin', 'INCLUDE_PATH' => '.:templates/webpages', + 'COMPILE_EXT' => $main::template_compile_ext, + 'COMPILE_DIR' => $main::template_compile_dir, }) || die; map { $additional_params->{$_} ||= $self->{$_} } keys %{ $self }; - my $in = IO::File->new($file, 'r'); - - if (!$in) { - print STDERR "Error opening template file: $!"; - $main::lxdebug->leave_sub(); - return ''; - } - - my $input = join('', <$in>); - $in->close(); - my $output; - if (!$template->process(\$input, $additional_params, \$output)) { + if (!$template->process($file, $additional_params, \$output)) { print STDERR $template->error(); } diff --git a/config/lx-erp.conf b/config/lx-erp.conf index 810c723ce..38c4f572f 100644 --- a/config/lx-erp.conf +++ b/config/lx-erp.conf @@ -13,6 +13,10 @@ $spool = "spool"; # templates base directory $templates = "templates"; +# template toolkit caching options +$template_compile_ext = '.tcc'; +$template_compile_dir = 'templates/cache'; + # member file $memberfile = "users/members"; -- 2.20.1