On Wed, 13 Jun 2001, Andy Wardley wrote:
> On Tue, Jun 12, 2001 at 08:48:58AM -0400, Drew Taylor wrote:
> > Count me in for this feature too. It bugs me that I have a whole large
> > directory structure to store my 2 levels of templates.
>
> There are a couple of problems with this. This first is that you could
> have more than one directory in your INCLUDE_PATH with the same file.
> e.g.
>
> my $tt2 = Template->new({
> INCLUDE_PATH => '/foo:/bar',
> COMPILE_DIR => '/tmp/tt2',
> });
>
> The file 'baz' could exist as both '/foo/baz' and '/bar/baz' but you would
> lose that distinction if you cached them as '/tmp/tt2/baz' instead of
> '/tmp/tt2/foo/baz' and '/tmp/tt2/bar/baz'.
I do use multiply include paths, so it's good for me :)
While we are on this topic, may I ask why templates starting with . or ..,
don't get cached? I know how it happens (_fetch is called instead of
_fetch_path) but I don't understand why? The docs don't mention this
"feature". I understand that if you specify: COMPILE_DIR => '/tmp/ttc'
and you have a relative path, it'll get off /tmp/tcc and things will get
broken in most cases. I've two solutions for this problem:
1. make sure that if ../../.. is the longest relative go back, your set
COMPILE_DIR to /tmp/tcc/1/2/3 (this can be documented as a solution)
2. while saving the compiled template, encode .. with something else, so
../../../foo becomes !..!..!..!foo and do the encode/decode when saving
and loading the file.
Thanks!
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/