function hosting_setup in Hosting 5
3 string references to 'hosting_setup'
- hosting_drush_command in ./
hosting.drush.inc - hosting_help in ./
hosting_help.inc - Implementation of hook_help()
- hosting_wizard_hosting_init in ./
hosting.wizard.inc - Form that confirms that cron is running, and that the platform has been successfuly verified
File
- ./
hosting.module, line 348 - Hosting module
Code
function hosting_setup() {
variable_set('hosting_dispatch_enabled', FALSE);
## attempting to run the dispatch command, to make sure it runs without the queue being
## enabled.
variable_set('hosting_dispatch_enabled', TRUE);
print _hosting_dispatch_cmd();
exec(_hosting_dispatch_cmd(), $return, $code);
variable_set('hosting_dispatch_enabled', FALSE);
$return = join("\n", $return);
$data = unserialize($return);
if ($code == DRUSH_SUCCESS) {
variable_set('hosting_dispatch_enabled', TRUE);
drush_log(t("Dispatch command was run successfully"), 'success');
_hosting_setup_cron();
}
else {
drush_set_error('DRUSH_FRAMEWORK_ERROR', dt("Dispatch command could not be run. Returned: \n@return", array(
'@return' => $return,
)));
}
if (drush_get_error()) {
print "\nThe command did not complete successfully, please fix the issues and re-run this script.";
}
}