Commit 3feba6e6 authored by mig5's avatar mig5 Committed by mig5
Browse files

#562164 by jonhattan - add conditional to _init functions to check command being run is provision

parent a3e8a8ca
......@@ -10,17 +10,21 @@
include_once('provision.mysql.inc');
function provision_mysql_drush_init() {
drush_set_default('master_db', $GLOBALS['db_url']);
$master_db = drush_get_option('master_db');
$db = parse_url($master_db);
drush_set_default('master_db_user', $db['user']);
drush_set_default('master_db_passwd', $db['pass']);
$command = drush_get_command();
$command = explode(" ", $command['command']);
if ($command[0] == 'provision') {
drush_set_default('master_db', $GLOBALS['db_url']);
$master_db = drush_get_option('master_db');
$db = parse_url($master_db);
drush_set_default('master_db_user', $db['user']);
drush_set_default('master_db_passwd', $db['pass']);
drush_set_default('master_db_host', $db['host']);
drush_set_default('db_host', $db['host']);
drush_set_default('master_db_type', $db['scheme']);
drush_set_default('db_type', $db['scheme']);
drush_set_default('master_db_host', $db['host']);
drush_set_default('db_host', $db['host']);
drush_set_default('master_db_type', $db['scheme']);
drush_set_default('db_type', $db['scheme']);
}
}
function provision_mysql_drush_exit() {
......
......@@ -12,39 +12,44 @@
*/
function provision_apache_drush_init() {
// Set up defines for platform
$docroot = drush_get_option(array("r", "root"), $_SERVER['PWD']);
$command = drush_get_command();
$command = explode(" ", $command['command']);
if ($command[0] == 'provision') {
$path = drush_set_default('docroot_path', rtrim(($docroot) ? $docroot : $_SERVER['DOCUMENT_ROOT'], '/'));
drush_set_default('sites_path', $path . '/sites');
drush_set_default('publish_path', drush_get_option('docroot_path'));
// Set up defines for platform
$docroot = drush_get_option(array("r", "root"), $_SERVER['PWD']);
$parts = explode("/", $path);
array_pop($parts);
$parent_path = drush_set_default('parent_path', implode("/" , $parts));
$path = drush_set_default('docroot_path', rtrim(($docroot) ? $docroot : $_SERVER['DOCUMENT_ROOT'], '/'));
drush_set_default('sites_path', $path . '/sites');
drush_set_default('publish_path', drush_get_option('docroot_path'));
$parts = explode("/", $path);
array_pop($parts);
$parent_path = drush_set_default('parent_path', implode("/" , $parts));
drush_set_default('backup_path', $parent_path . '/backups');
drush_set_default('config_path', $parent_path . '/config');
$config_path = drush_get_option('config_path');
drush_set_default('vhost_path', $config_path . '/vhost.d');
drush_set_default('backup_path', $parent_path . '/backups');
drush_set_default('config_path', $parent_path . '/config');
// Commands
drush_set_default('restart_cmd', _provision_default_restart_cmd());
$config_path = drush_get_option('config_path');
drush_set_default('vhost_path', $config_path . '/vhost.d');
// System account
drush_set_default('web_group', _provision_default_web_group());
drush_set_default('script_user', get_current_user());
// Commands
drush_set_default('restart_cmd', _provision_default_restart_cmd());
// Redirection urls
drush_set_default('master_url', $GLOBALS['base_url']);
$master_url = drush_get_option('master_url');
drush_set_default('web_disable_url', $master_url .'/hosting/disabled');
drush_set_default('web_maintenence_url', $master_url .'/hosting/maintenance');
// System account
drush_set_default('web_group', _provision_default_web_group());
drush_set_default('script_user', get_current_user());
drush_set_default('web_ip', '127.0.0.1');
drush_set_default('web_port', 80);
// Redirection urls
drush_set_default('master_url', $GLOBALS['base_url']);
$master_url = drush_get_option('master_url');
drush_set_default('web_disable_url', $master_url .'/hosting/disabled');
drush_set_default('web_maintenence_url', $master_url .'/hosting/maintenance');
drush_set_default('web_ip', '127.0.0.1');
drush_set_default('web_port', 80);
}
}
/**
......
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