drush_site_path() unaware of sites.php on D7

moshe weitzman - April 24, 2009 - 05:34
Project:Drush
Version:All-Versions-HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Owen Barton
Status:closed
Description

Has to handle the indirection provided by sites/sites.php

#1

moshe weitzman - April 24, 2009 - 05:34

BTW, sites.php might get backported to 6. it is rtbc there.

#2

moshe weitzman - April 24, 2009 - 05:48
Assigned to:adrian» Owen Barton

Actually, I think Owen last revamped this code.

#3

Owen Barton - May 14, 2009 - 05:58
Status:active» needs review

Something like this should do the trick - needs testing.

#4

moshe weitzman - May 14, 2009 - 11:59
Status:needs review» active

Oops - missing a patch

#5

Owen Barton - May 14, 2009 - 15:27
AttachmentSize
443576.patch 1.19 KB

#6

moshe weitzman - May 14, 2009 - 21:01
Status:active» needs review

I just tested again and I am seeing drush working perfectly even without this patch (patch does not break anything though). The line that sets conf_path correctly is   $conf_path = drush_bootstrap_value('conf_path', conf_path());.

I am tempted to won't fix this but maybe grugnog2 knows more.

i tested by renaming sites/default to sites/foo and creating a sites.php mapping that pointed 'd' to 'foo'. d is the domain of my dev server.

#7

Owen Barton - May 14, 2009 - 23:15

Yes - it will work find in most cases - since we use conf_path() and conf_path() does the sites.php translation. The case my patch could help with is if you have 'www.example.org' => 'funkysite' and you are within the sites/funkysite folder, then Drush will try and bootstrap with -l funkysite. The issue that could occur is that if there is URL sensitive code in Drupal (can think of a few examples) it would not operate correctly with the URL "funkysite", since it would be configured to check for the "www.example.org" URL.

I agree this is an edge case, and perhaps not worth dealing with at all.

A similar issue with this are of code that is perhaps bigger is that if you run local multisites in subdirectories your sites folders look like localhost.mysite, and the code will pass http://localhost.mysite verbatim in as the URL (rather than http://localhost/mysite which ). I think this works due to the way Drupal parses this, but is also liable to cause issues with any code that knows about full URLs.

#8

moshe weitzman - October 30, 2009 - 21:12
Status:needs review» fixed

Since you wrote it, we might as well cover the edge case. Committed. Feel free to reopen for the related issue in last paragraph of #7.

#9

System Message - November 13, 2009 - 21:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.