/[drupal]/contributions/modules/hosting/unpark.hostmaster.inc
ViewVC logotype

Contents of /contributions/modules/hosting/unpark.hostmaster.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Nov 5 16:58:50 2009 UTC (2 weeks, 4 days ago) by adrian
Branch: MAIN
Changes since 1.1: +1 -1 lines
File MIME type: text/x-php
Run hosting setup as part of unpark to create the new, working cronjob
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 drush_backend_invoke('hosting setup', array('uri' => $url));
21 } else {
22 return drush_set_error('PROVISION_FRAMEWORK_ERROR', dt("Could not find the node for platform path %platform", array('%platform' => $platform)));
23 }
24 // TODO: post migration tasks
25 // - save the drush log to the migrate task and set proper status
26 }

  ViewVC Help
Powered by ViewVC 1.1.2