| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
* @file Implementation of the hostmaster unpark command
|
| 5 |
*/
|
| 6 |
|
| 7 |
include_once('hosting.inc');
|
| 8 |
|
| 9 |
function drush_hosting_hostmaster_unpark($url) {
|
| 10 |
drush_log('bootstrapping drupal');
|
| 11 |
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
|
| 12 |
$platform = drush_get_context('DRUSH_DRUPAL_ROOT');
|
| 13 |
drush_log('fixing platform');
|
| 14 |
if ($platform_id = db_result(db_query('SELECT nid FROM {hosting_platform} WHERE publish_path = "%s"', $platform))) {
|
| 15 |
$nid = db_result(db_query('SELECT nid FROM {node} WHERE type = "site" AND status = 1 AND title = "%s"', $url));
|
| 16 |
$node = node_load($nid);
|
| 17 |
$node->verified = 0;
|
| 18 |
$node->platform = $platform_id;
|
| 19 |
node_save($node);
|
| 20 |
} else {
|
| 21 |
return drush_set_error('PROVISION_FRAMEWORK_ERROR', dt("Could not find the node for platform path %platform", array('%platform' => $platform)));
|
| 22 |
}
|
| 23 |
// TODO: post migration tasks
|
| 24 |
// - turn on new cron job
|
| 25 |
// - save the drush log to the migrate task and set proper status
|
| 26 |
}
|