Sans objet


Fri Jul 29 16:50:56 CEST 2011


templates to Perl code and save them to disk for subsequent use (i.e.
cache persistence). The COMPILE_EXT option may be provided to specify a
filename extension for compiled template files. It is undefined by
default and no attempt will be made to read or write any compiled
template files.

    my $template = Template->new({
        COMPILE_EXT => '.ttc',
    });

If COMPILE_EXT is defined (and COMPILE_DIR isn't, see below) then
compiled template files with the COMPILE_EXT extension will be written
to the same directory from which the source template files were loaded.

Compiling and subsequent reuse of templates happens automatically
whenever the COMPILE_EXT or COMPILE_DIR options are set. The Template
Toolkit will automatically reload and reuse compiled files when it finds
them on disk. If the corresponding source file has been modified since
the compiled version as written, then it will load and re-compile the
source and write a new compiled version to disk.

This form of cache persistence offers significant benefits in terms of
time and resources required to reload templates. Compiled templates can
be reloaded by a simple call to Perl's require(), leaving Perl to handle
all the parsing and compilation. This is a Good Thing.
-- 
Paul POULAIN
http://www.biblibre.com
Expert en Logiciels Libres pour l'info-doc
Tel : (33) 4 91 81 35 08


More information about the Koha-devel mailing list