The recent changes to the installer to support 'default.settings.php' broke the ability to recognize multisite directories during installation. conf_path() searches for an actual settings.php file, but now there are no such files. Alas, alack!
This patch adds a flag to the conf_path() function, allowing it to recognize matching directories during the install process even if they don't yet have settings files. It then creates the settings file, and all is well.
In the future, it's been suggested that we should prompt the user for all possible locations. That would be cool, but this works now. :)
Comments
Comment #1
moshe weitzman commentedMuch needed patch. After applying this, I could start the multisite install but not complete. I got
"Warning: fopen(./sites/mm.dr6a/settings.php)"
Somehow a period is there instead of a slash. should be
mm/dr6a
Maybe do some testing when installing into a subdir?
Comment #2
moshe weitzman commentedthe whole error, including line number, is
Warning: fopen(./sites/mm.dr6a/settings.php) [function.fopen]: failed to open stream: No such file or directory in /Users/mw/htd/dr6a/includes/install.inc on line 228
Comment #3
zarko commentedmoshe weitzman,
The behavior is consistent with the documentation at http://drupal.org/node/53705.
Comment #4
moshe weitzman commentedi worked on this for a bit and is definately busted. i know the behavior that zarko describes, but this something different.
Comment #5
eaton commentedTested and fixed. If no settings.php file is found during the initial installation, AND there is a directory that matches the current URL, THEN it will use that directory to create the new settings.php file.
Comment #6
eaton commentedComment #7
dries commentedThe PHPdoc comments are a bit techno-speak and are mildly confusing:
So if $require_settings is TRUE we allow matching directory names ... ?
Also, I think we need to explain this flag better; explain _why_ this is useful so the _when_ makes sense. :)
For example, your summary in the issue (i.e. if no settings.php file is found during the initial installation, AND there is a directory that matches the current URL, THEN it will use that directory to create the new settings.php file) is an order of magnitude more valuable than the current code/PHPdoc comments. :)
Comment #8
eaton commentedHere's the improved code comment:
Comment #9
eaton commentedAnd here it is without the embarassing typo!
Comment #10
dries commentedThe PHPdoc makes sense now. Thanks for updating it.
For me, this patch looks ready but it would be nice to get a review from the "conf_path architects" ...
Comment #11
eaton commentedEarl correctly noticed that the patch I attached was a borked version with a bad conditional check. This version includes the correct (working) version of the check. Thanks!
Comment #12
merlinofchaos commentedAfter review, this patch does what Eaton suggests and I believe is the correct short term (i.e, D6) solution.
Comment #13
eaton commentedRe-rolled. The previous version collided with the ip_address() patch due to a line ending. No code changes.
Comment #14
dries commentedCommitted to CVS HEAD. Thanks.
Comment #15
(not verified) commented