| 1 |
<?php
|
| 2 |
|
| 3 |
function drush_provision_mysql_provision_deploy_validate() {
|
| 4 |
provision_db_connect();
|
| 5 |
}
|
| 6 |
|
| 7 |
function drush_provision_mysql_provision_deploy($url) {
|
| 8 |
$db_type = drush_set_option('db_type', drush_get_option('db_type'), 'site');
|
| 9 |
$db_host = drush_set_option('db_host', drush_get_option('db_host'), 'site');
|
| 10 |
$db_passwd = drush_set_option('db_passwd', provision_password(), 'site');
|
| 11 |
$db_name = drush_set_option('db_name', _provision_mysql_suggest_db_name($url), 'site');
|
| 12 |
$db_user = drush_set_option('db_user', $db_name, 'site');
|
| 13 |
|
| 14 |
_provision_mysql_new_site_db($db_name, $db_user, $db_passwd);
|
| 15 |
|
| 16 |
_provision_mysql_import_dump(
|
| 17 |
drush_get_option('sites_path') .'/'. $url .'/database.sql',
|
| 18 |
$db_name, $db_user, $db_passwd, $db_host );
|
| 19 |
}
|
| 20 |
|
| 21 |
|
| 22 |
function drush_provision_mysql_provision_deploy_rollback($url = NULL) {
|
| 23 |
_provision_mysql_destroy_site_db(drush_get_option('db_name'), drush_get_option('db_user'), drush_get_option('db_passwd'));
|
| 24 |
}
|
| 25 |
|
| 26 |
// Rollback doesn't apply here yet. Unless we trigger a deploy of the first dump
|
| 27 |
// made. Which could go on infinitely if something is really long.
|
| 28 |
function drush_provision_mysql_post_provision_deploy($url = NULL) {
|
| 29 |
provision_path('unlink', drush_get_option('sites_path') .'/'. $url .'/database.sql', TRUE,
|
| 30 |
dt("Removed dump file @path after restoring from it"),
|
| 31 |
dt("Could not remove dump file @path"), 'DRUSH_PERM_ERROR');
|
| 32 |
}
|