Cache names not persist to current directory change
| From: | Dmitry Koteroff | Date: | Tue, 01 Jun 2004 15:56:57 +0000 |
| Subject: | Cache names not persist to current directory change | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-2355@lists.php.net to get a copy of this message | ||
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.
Maybe modify _get_compile_path() to use full path if it is
available?
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. :-)
--
Best regards,
Dmitry Koteroff.