Closed (fixed)
Project:
Cache Router
Version:
6.x-1.0-beta8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2008 at 14:54 UTC
Updated:
2 Oct 2009 at 16:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
XakepaBG commentedI've tried using this module on Windows too.
Paid attention to the error messages - seems the Drupal cache keys (filenames if using the 'file' engine) include colons and stars (':' and '*') which are illegal pathname characters on Windows..
Solution would be to patch ALL cache-related Drupal code to use some valid Windows characters instead..
I'll stick to the better solution - use Drupal in a proper LAMP stack set-up :-)
I hope this helps..
Comment #2
upsilone commentedHello,
I've tried using this module on Windows too.
Posible solution:
All in file.php:
1.- Add new method:
function appendix($key){
return str_replace(array(':'), array('-'), $key); // Can be '-' or other, but should be valid for NTFS ;)
}
2.- Change this line in function key at line ~157 after TODO ;)
// TODO make sure we always get valid filenames in the appendix
$appendix = $this->appendix(str_replace(array('/'), array('-'), $key));
3.- Change this line in function delete:
$look_for = explode('*', $this->appendix($key));
4.- a NEW BUG fixed:
Change this line in function delete: Failed if $key = "*"
if (!(strrpos($key, '*')===FALSE)) {
Enjoy!
Comment #3
harking commentedWe've run into a similar issue in the LAMP stack when the URL of the page is fairly long.
When the appendix is generated, it will be longer than the supported Linux ext3 file name length of 255 bytes.
The attached patch trims the appendix to be less than 255 and also handles the NTFS and FAT filesystem limits of 255 characters.
In addition, it handles removing all invalid file name characters for NTFS and FAT.
Comment #4
harking commentedComment #5
harking commentedThe previously posted patch is currently broken as either CacheRouter or Drupal's caching mechanisms require the : to be in place for key lookups.
I'll have to find another way to handle this issue. For now, the patch will continue to work on *nix systems if the ":" is removed from the str_replace() call
Comment #6
harking commentedUpdated the patch to work on Windows systems. Patch also now correctly updates the delete() function to correctly clear cache as needed.
Comment #7
greg.harveyCache clear now seems to work. Thanks. =)
Still getting #495736: Unwanted undefined index notice, which is preventing production usage right now on anything that matters. =/
Comment #8
JirkaRybka commentedI tackled filenames a fair bit over at #578522: File engine: Performance, filenames, and other cleanup, but otherwise it seems like rc1 did have this fixed already.
Comment #9
harking commentedIt looks like slantview committed this patch, so the patch will most likely no longer work with rc1.
I think my patch might have left out the fix for the 'delete' key lookup. I'll test and report back.
Comment #10
harking commentedLooks like delete() now calls key(), so his commit into trunk (and in rc1) will work great.
Suggest this issues be closed.
Comment #11
JirkaRybka commentedIt obviously got in with the big pack of fixes, although it's modified a little too.
So unless there are further concerns, this may be probably marked as "fixed".