Commit 3ba1abd7 authored by anarcat's avatar anarcat Committed by anarcat

#911422 - Pass in creds for create_site_database and import_site_database

parent 231c473d
......@@ -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.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment