-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make db-url a local option only (for sql and site-install commands)
- Loading branch information
Showing
2 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,8 @@ function drush_flatten_array($a) { | |
} | ||
|
||
/** | ||
* Get the available global options. Used by list/help commands. | ||
* Get the available global options. Used by list/help commands. All other users | ||
* should pull options from $application. | ||
* | ||
* @param boolean $brief | ||
* Return a reduced set of important options. Used by help command. | ||
|
@@ -252,7 +253,6 @@ function drush_get_global_options($brief = FALSE) { | |
$options['shell-aliases'] = array('hidden' => TRUE, 'merge' => TRUE, 'never-propagate' => TRUE, 'description' => 'List of shell aliases.'); | ||
$options['path-aliases'] = array('hidden' => TRUE, 'never-propagate' => TRUE, 'description' => 'Path aliases from site alias.'); | ||
$options['ssh-options'] = array('never-propagate' => TRUE, 'description' => 'A string of extra options that will be passed to the ssh command', 'example-value' => '-p 100'); | ||
$options['db-url'] = array('hidden' => TRUE, 'description' => 'A Drupal 6 style database URL. Used by various commands.', 'example-value' => 'mysql://root:[email protected]/db'); | ||
$options['drush-coverage'] = array('hidden' => TRUE, 'never-post' => TRUE, 'propagate-cli-value' => TRUE, 'description' => 'File to save code coverage data into.'); | ||
$options['local'] = array('propagate' => TRUE, 'description' => 'Don\'t look in global locations for commandfiles, config, and site aliases'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ class SiteInstallCommands extends DrushCommands { | |
* @aliases si | ||
* | ||
*/ | ||
public function install($profile, array $additional, $options = ['db-url' => NULL, 'db-prefix' => NULL, 'db-su' => NULL, 'db-su-pw' => NULL, 'account-name' => 'admin', 'account-mail' => '[email protected]', 'site-mail' => '[email protected]', 'account-pass' => NULL, 'locale' => 'en', 'site-name' => 'Drush Site-Install', 'site-pass' => NULL, 'sites-subdir' => NULL, 'config-dir' => NULL, 'show-passwords' => NULL]) { | ||
public function install($profile, array $additional, $options = ['db-url' => NULL, 'db-prefix' => NULL, 'db-su' => NULL, 'db-su-pw' => NULL, 'account-name' => 'admin', 'account-mail' => '[email protected]', 'site-mail' => '[email protected]', 'account-pass' => NULL, 'locale' => 'en', 'site-name' => 'Drush Site-Install', 'site-pass' => NULL, 'sites-subdir' => NULL, 'config-dir' => NULL]) { | ||
$form_options = []; | ||
foreach ((array)$additional as $arg) { | ||
list($key, $value) = explode('=', $arg, 2); | ||
|
@@ -66,7 +66,7 @@ public function install($profile, array $additional, $options = ['db-url' => NUL | |
$sql = SqlBase::create($options); | ||
$db_spec = $sql->getDbSpec(); | ||
|
||
$show_password = isset($options['show-passwords']) ? $options['show-passwords'] : empty($options['account-pass']); | ||
$show_password = empty($options['account-pass']); | ||
$account_pass = $options['account-pass'] ?: drush_generate_password(); | ||
$settings = array( | ||
'parameters' => array( | ||
|