Commit de1d8043 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

#321942 (primarily) - working config file generation and synch command. Also...

#321942 (primarily) - working config file generation and synch command. Also cleaned up variables passed to the system so the site_ prefix is no longer used.
parent 8ba84b5a
......@@ -43,7 +43,7 @@ function _provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host)
function _provision_mysql_destroy_site_db($db_name, $db_user, $db_passwd, $db_host) {
provision_set_active_db(_provision_master_db_url());
if ( _provision_mysql_database_exists($data['site_db_name']) ) {
if ( _provision_mysql_database_exists($data['db_name']) ) {
provision_log("notice", t("Dropping database @dbname", array('@dbname' => $db_name)));
_provision_mysql_drop_database($db_name);
}
......
......@@ -48,96 +48,47 @@ EOF;
return $help;
}
/**
* Implementation of provision_service()
*/
function provision_mysql_provision_service() {
return array("db_server" => t("Mysql database server"));
}
/**
* Implementation of provision_configure
*/
function provision_mysql_provision_configure($node = NULL) {
if (!is_object($node) && ($nid = variable_get('hosting_own_db_server', 0))) {
$node = node_load($nid);
}
$form['db_type'] = array('#type' => 'hidden', '#value' => ($node->db_type) ? $node->db_type : PROVISION_DB_TYPE);
$form['db_host'] = array(
'#type' => 'textfield',
'#title' => t('Database server hostname'),
'#description' => t('The address of the database server to connect to.'),
'#size' => 30,
'#default_value' => ($node->db_host) ? $node->db_host : PROVISION_DB_HOST,
'#maxlength' => 64,
'#weight' => 0,
);
$form['db_user'] = array(
'#type' => 'textfield',
'#required' => TRUE,
'#title' => t('Username'),
'#description' => t('The user that will be used to create users and databases for new sites.'),
'#size' => 40,
'#default_value' => ($node->db_user) ? $node->db_user : PROVISION_DB_USER,
'#maxlength' => 255,
'#weight' => 5,
);
if ($node->db_passwd) {
$passwd_description = t('<strong>You have already set a password for this database server.</strong><br />');
}
$form['db_passwd'] = array(
'#type' => 'password_confirm',
'#required' => (PROVISION_DB_PASSWD) ? FALSE : TRUE,
'#description' => $passwd_description . t('The user account that will be used to create new mysql users and databases for new sites'),
'#size' => 30,
'#weight' => 10
);
return $form;
}
/**
* @} end "ingroup provisionui"
*/
function provision_mysql_provision_pre_install($url, &$data) {
$data['site_db_type'] = ($data['site_db_type']) ? $data['site_db_type'] : PROVISION_DB_TYPE;
$data['site_db_host'] = ($data['site_db_host']) ? $data['site_db_host'] : PROVISION_DB_HOST;
$data['db_type'] = ($data['db_type']) ? $data['db_type'] : PROVISION_DB_TYPE;
$data['db_host'] = ($data['db_host']) ? $data['db_host'] : PROVISION_DB_HOST;
# generate a random password for use
$data['site_db_passwd'] = user_password();
$data['site_db_name'] = _provision_mysql_suggest_db_name($url, $data);
$data['site_db_user'] = $data['site_db_name'];
$data['db_passwd'] = user_password();
$data['db_name'] = _provision_mysql_suggest_db_name($url, $data);
$data['db_user'] = $data['db_name'];
return _provision_mysql_new_site_db($data['site_db_name'], $data['site_db_user'], $data['site_db_passwd'], $data['site_db_host']);
return _provision_mysql_new_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
}
function provision_mysql_provision_pre_install_rollback($url, &$data) {
_provision_mysql_destroy_site_db($data['site_db_name'], $data['site_db_user'], $data['site_db_passwd'], $data['site_db_host']);
unset($data['site_db_host']);
unset($data['site_db_type']);
unset($data['site_db_passwd']);
unset($data['site_db_user']);
unset($data['site_db_name']);
_provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
unset($data['db_host']);
unset($data['db_type']);
unset($data['db_passwd']);
unset($data['db_user']);
unset($data['db_name']);
}
function provision_mysql_provision_pre_restore($url, &$data) {
// store a backup of the credentials of the site.
$data['old_site_db_name'] = $data['site_db_name'];
$data['old_site_db_passwd'] = $data['site_db_passwd'];
$data['old_site_db_user'] = $data['site_db_user'];
$data['old_site_db_host'] = $data['site_db_host'];
$data['old_db_name'] = $data['db_name'];
$data['old_db_passwd'] = $data['db_passwd'];
$data['old_db_user'] = $data['db_user'];
$data['old_db_host'] = $data['db_host'];
# generate a random password for use
$data['site_db_passwd'] = user_password();
$data['site_db_name'] = _provision_mysql_suggest_db_name($url, $data);
$data['site_db_user'] = $data['site_db_name'];
$data['db_passwd'] = user_password();
$data['db_name'] = _provision_mysql_suggest_db_name($url, $data);
$data['db_user'] = $data['db_name'];
$success = _provision_mysql_new_site_db($data['site_db_name'], $data['site_db_user'], $data['site_db_passwd'], $data['site_db_host']);
$success = _provision_mysql_new_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
if ($success) {
_provision_mysql_import_dump(PROVISION_SITES_PATH .'/'. $url .'.restore/database.sql', $data['site_db_name'], $data['site_db_user'], $data['site_db_passwd'], $data['site_db_host']);
_provision_mysql_import_dump(PROVISION_SITES_PATH .'/'. $url .'.restore/database.sql', $data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
}
else {
provision_set_error(PROVISION_DB_ERROR);
......@@ -146,7 +97,7 @@ function provision_mysql_provision_pre_restore($url, &$data) {
}
function provision_mysql_provision_pre_restore_rollback($url, &$data) {
_provision_mysql_destroy_site_db($data['site_db_name'], $data['site_db_user'], $data['site_db_passwd'], $data['site_db_host']);
_provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
//Restore the original database credentials of the site.
foreach ($keys as $key) {
......@@ -160,7 +111,7 @@ function provision_mysql_provision_pre_restore_rollback($url, &$data) {
* This will drop the database, revoke the privileges and flush the privileges.
*/
function provision_mysql_provision_delete($url, &$data) {
return _provision_mysql_destroy_site_db($data['site_db_name'], $data['site_db_user'], $data['site_db_passwd'], $data['site_db_host']);
return _provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
}
// Rollback doesn't apply here yet. Unless we trigger a restore of the first dump
......@@ -169,13 +120,13 @@ function provision_mysql_provision_post_restore($url, &$data) {
provision_path('unlink', 'sites/'. $url .'/database.sql', TRUE,
t("Removed dump file @path after restoring from it"),
t("Could not remove dump file @path"), PROVISION_PERM_ERROR);
return _provision_mysql_destroy_site_db($data['old_site_db_name'], $data['old_site_db_user'], $data['old_site_db_passwd'], $data['old_site_db_host']);
return _provision_mysql_destroy_site_db($data['old_db_name'], $data['old_db_user'], $data['old_db_passwd'], $data['old_db_host']);
}
function provision_mysql_provision_backup($url, &$data) {
provision_log("backup", "Generating mysql dump for $url.");
provision_shell_exec("mysqldump -u%s -p%s %s > sites/%s/database.sql", $data['site_db_user'], $data['site_db_passwd'], $data['site_db_name'], $url);
provision_shell_exec("mysqldump -u%s -p%s %s > sites/%s/database.sql", $data['db_user'], $data['db_passwd'], $data['db_name'], $url);
provision_shell_exec("cd sites/%; tar -rf %s database.sql; rm database.sql", $url, $data['backup_file']);
}
......@@ -194,4 +145,4 @@ function provision_mysql_provision_verify() {
provision_log("message", t('Mysql can create new databases.'));
}
provision_set_active_db();
}
\ No newline at end of file
}
......@@ -423,8 +423,11 @@ function _provision_drupal_get_cvs_versions($files) {
function provision_drupal_provision_import($url, &$data) {
$sites = provision_drupal_find_sites();
foreach ($sites as $site => $file) {
if ($site == 'default') {
continue;
}
$info = _provision_drupal_import_site($site);
if ($info['site_installed']) {
if ($info['installed']) {
provision_log("notice", "Returning information for $site");
$data['sites'][$site] = $info;
}
......@@ -441,11 +444,11 @@ function _provision_drupal_import_site($url) {
include("sites/$url/settings.php");
if ($parts = @parse_url($db_url)) {
$data['site_db_type'] = $parts['scheme'];
$data['site_db_user'] = $parts['user'];
$data['site_db_host'] = $parts['host'];
$data['site_db_passwd'] = $parts['pass'];
$data['site_db_name'] = substr($parts['path'], 1);
$data['db_type'] = $parts['scheme'];
$data['db_user'] = $parts['user'];
$data['db_host'] = $parts['host'];
$data['db_passwd'] = $parts['pass'];
$data['db_name'] = substr($parts['path'], 1);
/**
* We need to be running AS the site to be able to see what profile it is installed with.
......@@ -454,14 +457,14 @@ function _provision_drupal_import_site($url) {
*/
provision_set_active_db($db_url);
$install_profile = db_result(db_query("SELECT value FROM {variable} WHERE name='install_profile'"));
$data['site_profile'] = ($install_profile) ? unserialize($install_profile) : 'default';
$data['profile'] = ($install_profile) ? unserialize($install_profile) : 'default';
$has_locale = db_result(db_query("SELECT status FROM {system} WHERE type='module' AND name='locale'"));
if ($has_locale) {
$locale = db_result(db_query("SELECT locale FROM {locales_meta} WHERE isdefault=1 AND enabled=1"));
}
$data['site_language'] = ($locale) ? ($locale) : 'en';
$data['language'] = ($locale) ? ($locale) : 'en';
provision_close_active_db();
$data['site_installed'] = TRUE;
$data['installed'] = TRUE;
}
provision_save_site_data($url, $data);
......
$db_url = '<?php print "$site_db_type://$site_db_user:$site_db_passwd@$site_db_host/$site_db_name"; ?>';
$profile = "<?php print $site_profile ?>";
<?php if ($site_locale != 'en') : ?>
$locale = '<?php print $site_locale; ?>';
<?php endif; ?>
$db_url = '<?php print "$db_type://$db_user:$db_passwd@$db_host/$db_name"; ?>';
$profile = "<?php print $profile ?>";
/**
* PHP settings:
*
......
......@@ -280,21 +280,17 @@ function provision_get_log() {
function provision_get_site_data($url) {
global $args;
//TODO: Accept serialized string via unix pipe.
foreach ($args['options'] as $key => $value) {
if (preg_match("/^site_/", $key)) {
$site_data[$key] = $value;
}
}
$site_data = $args['options'];
$site_data['site_url'] = $url;
$site_data['task_type'] = $args['commands'][1];
$site_data['task_id'] = drush_get_option('task_id', NULL);
$site_data['publish_path'] = PROVISION_DOCROOT_PATH;
$site_data['site_profile'] = ($site_data['site_profile']) ? $site_data['site_profile'] : variable_get('provision_default_profile', 'default');
$site_data['profile'] = ($site_data['profile']) ? $site_data['profile'] : variable_get('provision_default_profile', 'default');
$site_data['site_ip'] = variable_get('provision_apache_server_ip', '127.0.0.1');
$site_data['site_port'] = variable_get('provision_apache_server_ip', 80);
//Default to english language
$site_data['site_language'] = $site_data['site_language'] ? $site_data['site_language'] : 'en';
$site_data['language'] = $site_data['language'] ? $site_data['language'] : 'en';
if ($old_data = provision_load_site_data($url)) {
//Merge previously saved data with the new data. This way, old parameters overwrite new ones.
......@@ -358,12 +354,9 @@ function provision_save_site_data($url, $data) {
fwrite($fp, $line);
}
foreach ($data as $key => $value) {
if (preg_match('/^site_/', $key)) {
if ($data[$key] != $old_data[$key]) {
$line = "\n\$data['$key'] = ". var_export($value, TRUE) .';';
fwrite($fp, $line);
}
if ($data[$key] != $old_data[$key]) {
$line = "\n\$data['$key'] = ". var_export($value, TRUE) .';';
fwrite($fp, $line);
}
}
fclose($fp);
......@@ -391,12 +384,12 @@ function provision_save_site_data($url, $data) {
function provision_value_list() {
/** TODO: Complete the value list to allow the front end to more easily edit the settings. */
$values['site_url'] = t('The domain name used to access the site. This is defaulted to the value used on the command line.');
$values['site_db_type'] = t('The type of database server used');
$values['site_db_username'] = t('Username to access database for site');
$values['site_db_password'] = t('Password to access database for site');
$values['site_db_name'] = t('Database name for the site');
$values['site_profile'] = t('Install profile of site');
$values['site_task_type'] = t('What type of task has been used. Only used in conjuction with hosting front end');
$values['db_type'] = t('The type of database server used');
$values['db_username'] = t('Username to access database for site');
$values['db_password'] = t('Password to access database for site');
$values['db_name'] = t('Database name for the site');
$values['profile'] = t('Install profile of site');
$values['task_type'] = t('What type of task has been used. Only used in conjuction with hosting front end');
return $values;
}
......
......@@ -48,7 +48,6 @@
* program, but are configurable.
*/
function provision_init() {
// Set up defines for platform
if (function_exists('drush_get_option')) {
$docroot = drush_get_option(array("r", "root"), $_SERVER['PWD']);
......@@ -59,31 +58,47 @@ function provision_init() {
define('PROVISION_DOMAIN', $_SERVER['HTTP_HOST']);
$path = ($docroot) ? $docroot : $_SERVER['DOCUMENT_ROOT'];
define('PROVISION_DOCROOT_PATH', rtrim($path, '/'));
define('PROVISION_SITES_PATH', rtrim($path, '/') .'/sites');
define('PROVISION_DRUSH_PATH', drupal_get_path('module', 'drush') .'/drush.php');
define('PROVISION_DRUSH_PATH', './drush.php');
$parts = explode("/", rtrim($path, '/'));
array_pop($parts);
define('PROVISION_PARENT_PATH', rtrim(implode("/" , $parts), '/'));
define('PROVISION_BACKUP_PATH',
variable_get('provision_backup_path', PROVISION_PARENT_PATH .'/backups'));
define('PROVISION_CONFIG_PATH',
variable_get('provision_config_path', PROVISION_PARENT_PATH .'/config')) ;
if (file_exists('sites/default/provision.settings.php')) {
include_once('sites/default/provision.settings.php');
}
else {
$defaults = _provision_config_defaults();
define('PROVISION_BACKUP_PATH', $defaults['backup_path']);
define('PROVISION_CONFIG_PATH', $defaults['config_path']);
define('PROVISION_WEB_GROUP', $defaults['web_group']);
define('PROVISION_MASTER_DB', $defaults['master_db']);
define('PROVISION_SCRIPT_USER', $defaults['script_user']);
define('PROVISION_RESTART_CMD', $defaults['restart_cmd']);
define('PROVISION_MASTER_URL', $defaults['master_url']);
define('PROVISION_MASTER_DB', $defaults['master_db']);
}
# These settings are based on settings in the provision.settings.php file
define('PROVISION_VHOST_PATH', PROVISION_CONFIG_PATH .'/vhost.d');
define('PROVISION_DRUSHRC_PATH', PROVISION_CONFIG_PATH .'/drushrc.d');
define('PROVISION_WEB_DISABLE_URL', PROVISION_MASTER_URL .'/provision/disabled');
define('PROVISION_SCRIPT_USER', variable_get('provision_script_user', get_current_user()));
$info = posix_getgrgid(posix_getgid());
define('PROVISION_WEB_GROUP', variable_get('provision_web_group', $info['name']));
define('PROVISION_WEB_MAINTENENCE_URL', PROVISION_MASTER_URL .'/provision/maintenance');
$db = parse_url(PROVISION_MASTER_DB);
define('PROVISION_DB_TYPE', $db['scheme']);
define('PROVISION_DB_USER', $db['user']);
define('PROVISION_DB_PASSWD', $db['pass']);
define('PROVISION_DB_HOST', $db['host']);
define('PROVISION_DB_TYPE', variable_get('provision_db_type', 'mysqli'));
define('PROVISION_DB_USER', variable_get('provision_db_user', 'root'));
define('PROVISION_DB_PASSWD', variable_get('provision_db_passwd', 'root'));
define('PROVISION_DB_HOST', variable_get('provision_db_host', 'localhost'));
}
function _provision_default_restart_cmd() {
# try to detect the apache restart command
$command = '/usr/sbin/apachectl'; # a proper default for most of the world
foreach (array('/usr/local/sbin/apachectl', # freebsd
......@@ -93,31 +108,56 @@ function provision_init() {
$command = $test;
}
}
define('PROVISION_RESTART_CMD', variable_get('provision_restart_cmd', "sudo $command graceful"));
global $base_url;
define('PROVISION_BASE_URL', $base_url);
define('PROVISION_WEB_DISABLE_URL',
variable_get('provision_web_disable_url', $base_url .'/provision/disabled'));
define('PROVISION_WEB_MAINTENENCE_URL',
variable_get('provision_web_maintenance_url', $base_url .'/provision/maintenance'));
return "sudo $command graceful";
}
/**
* Implementation of hook_provision_service
* Provides a set of best guess values for the provision.settings.php file
*/
function provision_provision_service() {
return array('provision' => t("Basic configuration"));
}
function _provision_config_defaults() {
$default = array();
$defaults['backup_path'] = defined('PROVISION_BACKUP_PATH') ? PROVISION_BACKUP_PATH : PROVISION_PARENT_PATH .'/backups';
$defaults['config_path'] = defined('PROVISION_CONFIG_PATH') ? PROVISION_CONFIG_PATH : PROVISION_PARENT_PATH .'/config';
$defaults['script_user'] = defined('PROVISION_SCRIPT_USER') ? PROVISION_SCRIPT_USER : get_current_user();
$info = posix_getgrgid(posix_getgid());
$defaults['web_group'] = defined('PROVISION_WEB_GROUP') ? PROVISION_WEB_GROUP : $info['name'];
$defaults['master_db'] = defined('PROVISION_MASTER_DB') ? PROVISION_MASTER_DB : $GLOBALS['db_url'];
$defaults['restart_cmd'] = defined('PROVISION_RESTART_CMD') ? PROVISION_RESTART_CMD : _provision_default_restart_cmd();
$master_url = variable_get('provision_install_url', $GLOBALS['base_url']);
$defaults['master_url'] = defined('PROVISION_MASTER_URL') ? PROVISION_MASTER_URL : $master_url;
return $defaults;
}
/**
* Implementation of hook_perm().
* Generate a provision.settings.php file to configure provision
*/
function provision_perm() {
return array("administer provisioning");
function _provision_generate_config($data = array()) {
provision_log('notice', t("Generating provision.settings.php file"));
if (provision_path("exists", "sites/default/provision.settings.php")) {
provision_path("chmod", "sites/default/provision.settings.php", 0600,
t('Changed permissions of provision.settings.php to @confirm'),
t('Could not change permissions of provision.settings.php to @confirm'));
}
$data = array_merge(_provision_config_defaults(), $data);
$fp = fopen("sites/default/provision.settings.php", "w");
$text = file_get_contents(drupal_get_path('module', 'provision') .'/provision_settings.tpl.php');
fwrite($fp, "<?php\n". provision_render_config($text, $data));
fclose($fp);
# Change the permissions of the file
provision_path("chmod", "sites/default/provision.settings.php", 0400,
t('Changed permissions of provision.settings.php to @confirm'),
t('Could not change permissions of provision.settings.php to @confirm'));
return TRUE;
}
/**
......@@ -129,14 +169,6 @@ function provision_perm() {
* Implementation of hook_menu().
*/
function provision_menu($may_cache) {
$items[] = array(
'path' => 'admin/settings/provision',
'title' => t('Provisioning'),
'description' => t("Configure how new Drupal sites will be provisioned."),
'callback' => 'drupal_get_form',
'callback arguments' => array('provision_configure'),
'access' => user_access('administer provisioning'),
);
$items[] = array(
'path' => 'admin/help/provision/requirements',
'title' => t('Provisioning requirements'),
......@@ -173,46 +205,6 @@ function provision_site_maintenance() {
return "<p>This site is being worked on presently. Check back later.</p>";
}
/**
* Menu callback.
*
* Configuration screen for the provisioning framework.
*/
function provision_configure() {
$form['services'] = array('#type' => 'value');
foreach (module_implements('provision_configure') as $module) {
$data = module_invoke($module, 'provision_service');
$service = key($data);
$title = current($data);
$form['services']['#value'][] = $service;
$form[$service] = array(
'#type' => 'fieldset',
'#title' => $title,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#access' => user_access("administer $service provisioning"),
'#tree' => TRUE
);
$form[$service] = array_merge($form[$service], module_invoke($module, "provision_configure"));
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save settings'),
);
return $form;
}
function provision_configure_submit($form_id, $values) {
foreach ($values['services'] as $service) {
foreach ($values[$service] as $key => $value) {
variable_set('provision_'. $key, $value);
}
}
}
/**
* @} End of "defgroup provisionui"
*/
......@@ -235,8 +227,8 @@ function provision_drush_command() {
$items['provision synch'] = array(
'callback' => '_provision_synch',
'arguments' => array('domain.com' => t('The domain of the site to synch.')),
'description' => t('Regenerate all the config files for a site.')
'optional arguments' => array('domain.com' => t('The domain of the site to synch.')),
'description' => t('Regenerate the configuration files for a site or platform.')
);
$items['provision import'] = array(
......@@ -393,7 +385,7 @@ function _provision_install($url, &$data) {
if (!$rolled_back) {
_provision_drupal_switch_active_site($url); # Change headers and db info, also backs up
_provision_drupal_force_load_modules($url);
_provision_drupal_install_schema($data['site_profile'], $data['site_language']);
_provision_drupal_install_schema($data['profile'], $data['language']);
_provision_drupal_force_load_modules();
_provision_drupal_switch_active_site(); # This *should* bring the site back to where we were before installing
......@@ -418,7 +410,7 @@ function _provision_install($url, &$data) {
function _provision_post_install($url, &$data) {
$rolled_back = provision_invoke("post_install", $url, $data);
if (!$rolled_back) {
$data['site_installed'] = TRUE;
$data['installed'] = TRUE;
}
return $rolled_back;
}
......@@ -432,21 +424,28 @@ function _provision_post_install($url, &$data) {
* Output of provision_output() function.
* Will exit with a PROVISION_SITE_NOT_FOUND error if the site does not exist.
*/
function _provision_synch($url) {
if (!_provision_drupal_site_installed($url)) {
provision_log("error", "Site has not been installed yet.");
provision_set_error(PROVISION_SITE_NOT_FOUND);
function _provision_synch($url = NULL) {
if (!$url) {
global $args;
_provision_generate_config($args['options']);
provision_output(NULL, $args['options']);
}
else {
if (!_provision_drupal_site_installed($url)) {
provision_log("error", "Site has not been installed yet.");
provision_set_error(PROVISION_SITE_NOT_FOUND);
provision_output();
}
$data = provision_get_site_data($url);
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories($url, $data['profile']);
$rolled_back = provision_invoke("synch", $url, $data);
// Requires at least the database settings to complete.
_provision_drupal_create_settings_file($url, $data);
$data['installed'] = TRUE;
provision_save_site_data($url, $data);
provision_output($url, $data);
}
$data = provision_get_site_data($url);
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories($url, $data['profile']);
$rolled_back = provision_invoke("synch", $url, $data);
// Requires at least the database settings to complete.
_provision_drupal_create_settings_file($url, $data);
$data['site_installed'] = TRUE;
provision_save_site_data($url, $data);
provision_output($url, $data);
}
/**
......@@ -470,7 +469,7 @@ function _provision_backup($url) {
$file = array_shift($args);
_provision_backup_site($url, $data, $file);
$data['site_installed'] = TRUE;
$data['installed'] = TRUE;
provision_save_site_data($url, $data);
provision_output($url, $data);
......@@ -640,7 +639,7 @@ function _provision_disable($url) {
$rolled_back = provision_invoke("disable", $url, $data);
$data['site_enabled'] = FALSE;
$data['enabled'] = FALSE;
provision_save_site_data($url, $data);
provision_output($url, $data);
}
......@@ -655,7 +654,7 @@ function _provision_enable($url) {
$rolled_back = provision_invoke("enable", $url, $data);
$data['site_enabled'] = TRUE;
$data['enabled'] = TRUE;
provision_save_site_data($url, $data);
provision_output($url, $data);
}
......@@ -689,9 +688,8 @@ function _provision_setup() {
t('Created symlink for drush.php file'),
t('Could not create symlink for drush.php'),
PROVISION_FRAMEWORK_ERROR);
$success &= _provision_create_dir(PROVISION_CONFIG_PATH, t('Config path'), 0700);
$success &= _provision_create_dir(PROVISION_DRUSHRC_PATH, t('Drush config path'), 0700);
$success &= _provision_generate_config();
return $success;
}
......
/**
* This configuration file manages the settings for the provisionining back end of the Aegir hosting system.
*
* This file was automatically created for you by the provision setup functionality, to test the settings in
* this file, please run the provision verify command.
*
*/
/**
* Directory to store site backups.
*
* If you have multiple provision managed platforms on this system, it is highly
* recommended to use the same path for each platform you have.
*/
define('PROVISION_BACKUP_PATH', '<?php print $backup_path ?>');