Bug #19220 [Opn->Ana]: Empty cache files are not ignored
| From: | borz_off at cs dot msu dot su | Date: | Wed, 14 Mar 2012 11:16:53 +0000 |
| Subject: | Bug #19220 [Opn->Ana]: Empty cache files are not ignored | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8392@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19220&edit=1
ID: 19220
Updated by: borz_off@cs.msu.su
Reported By: brendan at syra dot com dot au
Summary: Empty cache files are not ignored
-Status: Open
+Status: Analyzed
Type: Bug
Package: HTML_Template_Sigma
Operating System: Debian GNU/Linux 6.0
Package Version: 1.2.0
PHP Version: 5.3.8
-Assigned To:
+Assigned To: avb
Roadmap Versions:
New Comment:
-Status: Open
+Status: Analyzed
-Assigned To:
+Assigned To: avb
I think that rather than add a special case for cache loading, we need a
more robust cache writing algorithm:
1) Cached template should be saved to a temporary file and then moved
to a permanent filename;
2) An error should be raised if cache file cannot be saved or moved;
Also probably:
1) Cache file should be touch()ed with mtime of original filename;
2) _isCached() should check mtimes for equality.
Now if the template is replaced with an older version the cached file
will not be regenerated, which is a minor WTF factor.
Previous Comments:
------------------------------------------------------------------------
[2012-01-13 04:20:50] brendansyra
Description:
------------
We have run into this problem several times, when for whatever reason
the server has run out of space. HTML_Template_Sigma creates the cache
file but is unable to write data to it.
On first run, the template data is loaded fine as the cache file is only
created (it is left with a file size of zero) and not used. Any
subsequent time the script is run however, the cache file is read, which
results in HTML_Template_Sigma throwing a "Cannot find block
'__global__'" exception.
HTML_Template_Sigma should ignore/remove the empty cache file instead of
trying to read it.
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19220&edit=1