summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2010-12-20 19:47:26 (GMT)
committeranarcat2010-12-20 19:47:26 (GMT)
commit3ba1abd7d55896151285f07aff203b99e27f6230 (patch)
treef0927183e2217f3d6528f4dbd1d826f6ecb66c13
parent231c473d6c559b1348485031147d36b8347baf96 (diff)
#911422 - Pass in creds for create_site_database and import_site_database
-rw-r--r--db/db.drush.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/db/db.drush.inc b/db/db.drush.inc
index be9f2ea..e1a6ab9 100644
--- a/db/db.drush.inc
+++ b/db/db.drush.inc
@@ -91,8 +91,10 @@ class provisionService_db extends provisionService {
/**
* Generate a new mysql database and user account for the specified credentials
*/
- function create_site_database() {
- $creds = $this->generate_site_credentials();
+ function create_site_database($creds = array()) {
+ if (!sizeof($creds)) {
+ $creds = $this->generate_site_credentials();
+ }
extract($creds);
if (!$this->can_create_database()) {
@@ -150,12 +152,14 @@ class provisionService_db extends provisionService {
}
- function import_site_database($dump_file = null) {
+ function import_site_database($dump_file = null, $creds = array()) {
if (is_null($dump_file)) {
$dump_file = d()->site_path . '/database.sql';
}
- $creds = $this->fetch_site_credentials();
+ if (!sizeof($creds)) {
+ $creds = $this->fetch_site_credentials();
+ }
$exists = provision_file()->exists($dump_file)
->succeed('Found database dump at @path.')