Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #6902 Problem w/ cache filename on Windows
Submitted: 2006-02-23 05:40 UTC Modified: 2006-05-30 16:37 UTC
From: slaurencot at sqli dot com Assigned: avb
Status: Closed Package: HTML_Template_Sigma (version 1.1.4)
PHP Version: 4.3.11 OS: WinXP
Roadmaps: (Not assigned)    
Subscription  


 [2006-02-23 05:40 UTC] slaurencot at sqli dot com (stephane)
Description: ------------ The cache filename returned by _cachedName() isn't correct on Windows if using absolute path. Ex. if I have 2 templates, "c:/template/tmp1.tpl" and "c:/template/tmp2.tpl", _cachedName() will return "c" as cachedName 2 times. Test script: --------------- A solution is to remove ":" in $filename : function _cachedName($filename) { if ('/' == $filename{0} && '/' == substr($this->_cacheRoot, -1)) { $filename = substr($filename, 1); } $filename = str_replace('/', '__', $filename); // The str_replace below correct the problem $filename = str_replace(':', '', $filename); return $this->_cacheRoot. $filename. '.it'; } // _cachedName

Comments

 [2006-02-26 13:26 UTC] avb
The same problem exists with checking for absolute path in _sourceName(). Both methods should be changed to take into account Windows drive letters.
 [2006-05-30 16:37 UTC] avb (Alexey Borzov)
Fixed in CVS: filenames for cached files are now generated correctly on Windows. Looks like there is no need to change the other behaviour, though.