Skip to content

Commit

Permalink
Make db-url a local option only (for sql and site-install commands)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Mar 28, 2017
1 parent b6c2744 commit 4bcd789
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions includes/drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/core/SiteInstallCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand Down

0 comments on commit 4bcd789

Please sign in to comment.