Re: [SMARTY-DEV] clear_compiled_tpl() bug or missing feature
| From: | Bharat Mediratta | Date: | Fri, 07 Nov 2003 04:40:49 +0000 |
| Subject: | Re: [SMARTY-DEV] clear_compiled_tpl() bug or missing feature | ||
| References: | 1 2 3 4 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1917@lists.php.net to get a copy of this message | ||
From: "Jan Rosier / Interstroom" <rosier@interstroom.nl>
...
> I like the idea of adding the version value into the filename.
>
> To prevent bulky cache and compile dirs a function like the one below
could
> be added. This function must be call after the compile_dir is set.
>
This would be fine, except that using the product version isn't
going to be good enough unless it also incorporates the template
compatibility version (eg, the core restructuring happened in
"2.6.0-cvs" so we'd have to detec this change and flush our templates
even though the product version number didn't change).
Smarty needs to maintain a new, separate version, eg:
/**
* Template version number
*/
$_template_version_number = 1;
If this number is bumped every time there's a cvs commit that
breaks template compatibility, it'd allow those of us tracking
CVS to use it in our projects without worrying about users
that track *our* projects via CVS having broken templates.
I prefer Jan's solution over Monte's follow-on suggestion of
putting the version number into the path (which would have to
incorporate the template version number, of course) because
Jan's solution won't leave any cruft files around for the end user
to have to clean up.
-Bharat