Re: Cache names not persist to current directory change

messju mohr <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
On Tue, Jun 01, 2004 at 07:56:57PM +0400, Dmitry Koteroff wrote:
> Hello.
> 
> If  I  have  2  templates  with  name  a.tpl (/some/dir/a.tpl and
> /other/dir/a.tpl) and use code something like this:
> 
> chdir("/some/dir");
> $output = $smarty->fetch("a.tpl");
> chdir("/other/dir");
> $output = $smarty->fetch("a.tpl");
> 
> compiled caches for these tempates are in conflict.

yes. if you didn't configure template_dir with an absolute path you
are effectively using two different template_dirs when changing the
pwd. you need a distinct compile_dir for each template_dir you use.

> Maybe  modify  _get_compile_path()  to  use  full  path if it is
> available?

no.
 
> I know that $resource_name is not modified inside fetch() at all,
> and   it   could  be  not  only  filename,  but  something  else.
> _fetch_resource_info()  also  does  not  return information about
> path.
> 
> In  my  procram  I  can  use, of course, realpath(). But if I use
> {include} directly in the template, I cannot call realpath().
> 
> Including  of  other files from the template is used very often -
> for example, header/footer.
> 
> 
> P.S.
> 
> File  plugins\function.fetch.php,  line  194. You have missed the
> operator:
> 
> $content = '';
> 
> (Appositely,  Antony,  here  is  the illustration of E_NOTICE=off
> mortal effect. :-)

uh, yes *very* mortal: we use of an undefined value! the world will
collapse and all out boxes will get rooted immediately! :)

> -- 
> Best regards,
>   Dmitry Koteroff.

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.