-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multisite setup enhancements and bugfixes #2997
Changes from 9 commits
18aab15
cbe3a21
ee700f6
048bd26
8fd0e1a
2ab3672
28fd768
064e415
b0348fa
b6bc8f5
ae0484e
051d77d
25741a1
621d2ac
d6baead
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,12 @@ public function generateSiteConfigFiles() { | |
$default_local_drush_file = "$multisite_dir/default.local.drush.yml"; | ||
$project_local_drush_file = "$multisite_dir/local.drush.yml"; | ||
|
||
// Generate sites.php for local multisite. | ||
$site_local_hostname = $this->getConfigValue('project.local.hostname'); | ||
$sites[$site_local_hostname] = $multisite; | ||
$contents = "<?php\n \$sites = " . var_export($sites, TRUE) . ";"; | ||
file_put_contents($this->getConfigValue('docroot') . "/sites/sites.php", $contents); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing this in the foreach loop results in the file being written repeatedly. Since the $sites variable is accreting keys in the loop, could writing the file be moved out of the loop and done a single time at the end? |
||
|
||
$copy_map = [ | ||
$blt_local_settings_file => $default_local_settings_file, | ||
$default_local_settings_file => $project_local_settings_file, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ public function testMultisiteGenerate() { | |
$this->assertEquals("$this->site1Dir.clone", $site1_blt_yml['drush']['aliases']['remote']); | ||
|
||
$site2_blt_yml = YamlMunge::parseFile("$this->sandboxInstance/docroot/sites/$this->site2Dir/blt.yml"); | ||
$this->assertEquals("$this->site2Dir.local", $site2_blt_yml['drush']['aliases']['local']); | ||
$this->assertEquals("self", $site1_blt_yml['drush']['aliases']['local']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be using |
||
$this->assertEquals("$this->site2Dir.clone", $site2_blt_yml['drush']['aliases']['remote']); | ||
|
||
// Clone. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pedantic of me, but I'd like to see the $sites variable declared above the start of the loop so that the code is a bit more readable.