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
BTW, sites.php might get backported to 6. it is rtbc there.
#2
Actually, I think Owen last revamped this code.
#3
Something like this should do the trick - needs testing.
#4
Oops - missing a patch
#5
#6
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
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
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
Automatically closed -- issue fixed for 2 weeks with no activity.