'key=value...' => 'any additional settings you wish to pass to the profile. Only support on D7. The key is in the form [form name].[parameter name].',
),
'options' => array(
- 'db-url' => 'A Drupal 5/6 style database URL. Only required for initial install - not re-install.',
- 'db-prefix' => 'An optional table prefix to use for initial install.',
'account-name' => 'uid1 name. defaults to admin',
'account-pass' => 'uid1 pass. defaults to admin',
'account-mail' => 'uid1 email. defaults to admin@example.com',
+ 'db-url' => 'A Drupal 5/6 style database URL. Only required for initial install - not re-install.',
+ 'db-prefix' => 'An optional table prefix to use for initial install.',
+ 'db-su' => 'Account to use when creating a new database. Optional.',
+ 'db-su-pw' => 'Password for the "db-su" account. Optional.',
'locale' => 'A short language code. Sets the default site language. Language files must already be present. You may use download command to get them.',
'clean-url'=> 'Defaults to 1',
'site-name' => 'Defaults to Site-Install',
// are about to DROP. @see _drush_sql_get_credentials().
$create_db_spec = $db_spec;
unset($create_db_spec['database']);
- if (!_drush_sql_query($sql, $create_db_spec)) {
+ $create_db_su = drush_sql_su($create_db_spec);
+ if (!_drush_sql_query($sql, $create_db_su)) {
// If we could not drop the database, try instead to drop all
// of the tables in the database (presuming it exists...).
// If we cannot do either operation, then fail with an error.
}
/*
+ * Build DB connection array with superuser credentials if provided.
+ */
+function drush_sql_su($db_spec) {
+ $create_db_target = $db_spec;
+ $create_db_target['database'] = '';
+ $db_superuser = drush_get_option(array('db-su', 'target-db-su'));
+ if (isset($db_superuser)) {
+ $create_db_target['username'] = $db_superuser;
+ }
+ $db_su_pw = drush_get_option(array('db-su-pw', 'target-db-su-pw'));
+ if (isset($db_su_pw)) {
+ $create_db_target['password'] = $db_su_pw;
+ }
+ return $create_db_target;
+}
+
+/*
* Build a SQL string for dropping and creating a database.
*
* @param array $db_spec
$pre_import_commands = '';
$create_db = drush_get_option('create-db');
if (isset($create_db)) {
- $create_db_target = $target_db_url;
- $create_db_target['database'] = '';
- $db_superuser = drush_get_option(array('db-su', 'target-db-su'));
- if (isset($db_superuser)) {
- $create_db_target['username'] = $db_superuser;
- }
- $db_su_pw = drush_get_option(array('db-su-pw', 'target-db-su-pw'));
- if (isset($db_su_pw)) {
- $create_db_target['password'] = $db_su_pw;
- }
- $db_su_connect = _drush_sql_connect($create_db_target);
+ $create_db_su = drush_sql_su($target_db_url);
+ $db_su_connect = _drush_sql_connect($create_db_su);
$pre_import_sql = drush_sql_build_createdb_sql($target_db_url);
$pre_import_commands = sprintf('echo "%s" | %s; ', $pre_import_sql, $db_su_connect);
}
updatedb: GOOD. Implicitly tested siteUpgradeTest.
-archive-dump
+archive-dump: GOOD
+archive-restore:
help
version: Good. Implicit by testStandaloneScript()
self-update
-------------
drush
drush.php
-drush.bat
\ No newline at end of file
+drush.bat