[PATCH] use realpath in templates_c/ and cache/
| From: | Hans Jürgen von Lengerke | Date: | Thu, 22 Apr 2004 21:25:35 +0000 |
| Subject: | [PATCH] use realpath in templates_c/ and cache/ | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-2301@lists.php.net to get a copy of this message | ||
Hello,
the attached patch adds the capability to use several template
directories together with one single compile and cache dir. This is done
by using the realpath to the template file instead of crc32 as a
compile/cache key. The patch adds a new, readily documented option to
smarty, $use_realpath, that is set to FALSE by default. Setting this to
TRUE will result in the described behaviour. This works also with
$use_sub_dirs set to FALSE, albeit this is not recommended because it
results in very long filenames.
I know there was discussion before whether this behaviour should be
added to Smarty and Messju said no because it would slow down
performance
(http://marc.theaimsgroup.com/?l=smarty-dev&m=106867297300354&w=2).
Well, for one I think this performance decrease is neglectible and since
this is configurable now one can just leave it off.
This patch is also helpful if you need to find compiled and cached files
quickly for debugging templates.
I hope this patch can be added. The patch is against current CVS
development version.
Hans