Hi All,

I recently started using Cache Router and found 2 issues that I've created a fix for. Below are the two issues that I found. I've also attached a patch for the engines/file.php file that solves these issues from my perspective. Please let me know what you think. I'm very interested in getting feedback as this is the first patch that I've ever submitted!

Problem #1 (bug)
Line 102 in the original file.php file has the following code: @chmod(0664, $file); // Necessary for non-webserver users.

This code is a bug because it flips the order of the arguments for chmod. And so this code never gets executed. But normally, you wouldn't know that it's not executing because the @ operator suppresses the error messages. My patch flips the order of the arguments so that they are correct.

Problem #2 (incompatibility with drush)
As described in my earlier comment #642544: Weird thing. Keeps happening., the Cache Router code in RC1 doesn't work well with drush because drush may execute as a different user than the web server.

My patch looks for a new configuration for the file engine that is called allow_global_file_write. If the allow_global_file_write value is TRUE, then the Cache Router file engine will make all cache directories and files globally writable. If the allow_global_file_write value is FALSE, then the Cache Router file engine will make the cache directories and files only writable by the file/directory owner and the accounts that are in the same group as the owner.

The default value for allow_global_file_write is FALSE. And so the patch maintains the current behavior of Cache Router unless the admin purposefully sets the allow_global_file_write configuration to be TRUE.

CommentFileSizeAuthor
file.php_.patch1.98 KBdparkmit
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Status: Active » Closed (duplicate)

This is a duplicate of #578522: File engine: Performance, filenames, and other cleanup

Use dev version until next RC is ready

dparkmit’s picture

Thx for letting me know. I have 3 follow-up questions.

1. How stable is the dev version compared to the current RC? We're developing for a new production site that will launch in early July. And I'd greatly prefer to have a stable version running.

2. Will the new RC work for Drupal 6? The comment that you pointed me to #578522: File engine: Performance, filenames, and other cleanup seems to be for Drupal 7 rather than Drupal 6. We're currently planning on using Drupal 6 for a while. I'm a newbie and so may have just misread the information in the comment.

3. Does the new code address the specific issue regarding file permissions that I identified? I read all the comments and they didn't mention the file permissions issue.

Thanks for the help!