More accurate compiled file names
| From: | Dmitry Koteroff | Date: | Sat, 29 May 2004 22:31:49 +0000 |
| Subject: | More accurate compiled file names | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-2323@lists.php.net to get a copy of this message | ||
Hello.
Smarty saves its compiled code to files with unreadable names
(like %%23t2763%%sjhdjsdhjshgd.php). It makes too difficult to
find fatal error in the template (for example, {$obj->spoon()},
where spoon is non-existent method).
Attached patch corrects this problem - it replaces "/" by "^" and
saves the file to temporary location.
Replacement code:
$_filename = preg_replace("{[/\\\\]}s", "^", $_filename);
$_filename = preg_replace("{[^a-z0-9~!_=.^-]}si", "_", $_filename);
Don't you plan to insert this patch to production version?
--
Best regards,
Dmitry Koteroff.