Commit 20958e7b authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

#319271 - provision backend port committed to HEAD

parent 35075a60
name = Provision: Mysql
description = Provides provisioning requirements for the Mysql database
package = Provision
dependencies = provision
dependencies[] = provision
core = 6.x
\ No newline at end of file
name = Provision: Drupal
description = Allows for Drupal sites to be provisioned using the provisioning framework.
package = Provision
dependencies = drush provision cvs_deploy
dependencies[] = drush
dependencies[] = provision
dependencies[] = cvs_deploy
core = 6.x
\ No newline at end of file
......@@ -8,61 +8,6 @@
* and all the install api code.
*/
/**
* @ingroup provisionui
* @{
*/
/**
* Implementation of hook_provision_service()
*/
function provision_drupal_provision_service() {
return array('drupal' => t("Drupal sites"));
}
/**
* Implentation of hook_provision_configure()
* @TODO: PROPER profile support
function provision_drupal_provision_configure() {
$profiles = file_scan_directory('./profiles', '\.profile$', array('.', '..', 'CVS'), 0, TRUE, 'name', 0);
// Don't need to choose profile if only one available.
if (sizeof($profiles) == 1) {
$profile = array_pop($profiles);
$form['default_profile'] = array('#type' => 'value', '#value' => $profile->name);
}
elseif (sizeof($profiles) > 1) {
foreach ($profiles as $profile) {
if ($_POST['profile'] == $profile->name) {
$options[$profile->name] = $profile->name;
}
}
$form['provision_default_profile'] = array(
'#type' => 'radios',
'#title' => t('Default install profile'),
'#description' => t('New sites will be created with the following install profile'),
'#options' => $options,
'#default_value' => variable_get('provision_default_profile', 'default'),
);
}
return $form;
}
//*/
/**
* Implementation of hook_provision_templates
*/
function provision_drupal_provision_templates() {
// settings template
}
/**
* @} End "ingroup provisionui"
*/
/**
* Test to see if the site settings.php exists
*
......@@ -326,9 +271,28 @@ function _provision_drupal_install_schema($profile, $language = 'en', $client_em
provision_set_error(PROVISION_FRAMEWORK_ERROR);
return FALSE;
}
// install system.module
drupal_install_system();
$modules = array_diff($modules, array('system'));
// install other modules
$files = module_rebuild_cache();
$operations = array();
foreach ($modules as $module) {
_drupal_install_module($module);
module_enable(array($module));
}
// Rebuild menu to get content type links registered by the profile,
// and possibly any other menu items created through the tasks.
menu_rebuild();
// Register actions declared by any modules.
actions_synchronize();
// Perform actual installation defined in the profile.
drupal_install_profile($profile, $modules);
// Randomize query-strings on css/js files, to hide the fact that
// this is a new install, not upgraded yet.
_drupal_flush_css_js();
// Show profile finalization info.
$function = $profile .'_profile_final';
......@@ -339,7 +303,7 @@ function _provision_drupal_install_schema($profile, $language = 'en', $client_em
if ($client_email) {
// create the admin account
$account = new stdClass();
$account = user_load(1);
$edit['name'] = 'admin';
$edit['pass'] = user_password();
$edit['mail'] = $client_email;
......@@ -352,8 +316,8 @@ function _provision_drupal_install_schema($profile, $language = 'en', $client_em
$variables = array(
'!username' => $account->name, '!site' => variable_get('site_name', 'Drupal'), '!login_url' => $onetime,
'!uri' => $base_url, '!uri_brief' => preg_replace('!^https?://!', '', $base_url), '!mailto' => $account->mail,
'!date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE),
'!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE));
'!date' => format_date(time()), '!login_uri' => url('user', array('absolute' => TRUE)),
'!edit_uri' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE)));
// allow the profile to override welcome email text
if (file_exists("./profiles/$profile/provision_welcome_mail.inc")) {
......@@ -464,6 +428,7 @@ function _provision_drupal_get_cvs_versions($files) {
$project = array();
$project['filename'] = $file->filename;
$project['name'] = $file->name;
$file->info['description'] = str_replace("\n", "", $file->info['description']);
if (empty($project['project'])) {
$project['project'] = cvs_deploy_get_project_name($project);
}
......
......@@ -78,8 +78,8 @@ function _provision_help_class($state) {
/**
* Implementation of hook_help()
*/
function provision_help($section) {
switch ($section) {
function provision_help($path, $arg) {
switch ($path) {
case 'admin/help#provision':
$output .= t('<p>The Provision framework is a powerful set of modules that lets you to accomplish a lot of maintenance tasks through the unix command line such as installing new sites, backing them up, rolling back to previous backups and facilitating upgrades.</p>');
$output .= t('<p>Additionally, the Provision framework is one component of the distributed hosting infrastructure provided by the <code>hostmaster</code> install profile.
......@@ -260,7 +260,7 @@ function provision_elements() {
PROVISION_STATUS_SUCCESS => t("You have met this requirement."),
PROVISION_STATUS_WARNING => t("This requirement has a non critical error."),
PROVISION_STATUS_ERROR => t("This requirement has a critical error. This system will not operate until it has been fixed")),
'#process' => array('provision_requirement_process' => array()),
'#process' => array('provision_requirement_process'),
);
return $type;
}
......
<?php
// $Id$
/**
* @file
* The provisioning framework API.
......
name = Provision
description = Allows for the automated provisioning of hosted Drupal sites, via the command line
package = Provision
dependencies = drush
dependencies[] = drush
core = 6.x
\ No newline at end of file
......@@ -168,46 +168,41 @@ function _provision_generate_config($data = array()) {
/**
* Implementation of hook_menu().
*/
function provision_menu($may_cache) {
$items[] = array(
'path' => 'admin/help/provision/requirements',
'title' => t('Provisioning requirements'),
'description' => t("Information of how to configure the provisioning system."),
'callback' => 'provision_help_requirements',
function provision_menu() {
$items['admin/help/provision/requirements'] = array(
'title' => 'Provisioning requirements',
'description' => "Information of how to configure the provisioning system.",
'page callback' => 'provision_help_requirements',
'type' => MENU_CALLBACK
);
$items[] = array(
'path' => 'provision',
'title' => t('Configure your platform'),
'description' => t('Configure your platform.'),
'callback' => 'provision_front',
$items['provision'] = array(
'title' => 'Configure your platform',
'description' => 'Configure your platform.',
'page callback' => 'provision_front',
'type' => MENU_CALLBACK,
'access' => TRUE,
'access arguments' => TRUE,
);
$items[] = array(
'path' => 'provision/disabled',
'title' => t('Site disabled'),
'description' => t('Page showed when a site is disabled.'),
'callback' => 'provision_disabled_site',
$items['provision/disabled'] = array(
'title' => 'Site disabled',
'description' => 'Page showed when a site is disabled.',
'page callback' => 'provision_disabled_site',
'type' => MENU_CALLBACK,
'access' => user_access('access content'),
'access arguments' => array('access content'),
);
$items[] = array(
'path' => 'provision/maintenance',
'title' => t('Site is undergoing maintenance.'),
'description' => t('Page shown when a site is being restored or moved etc.'),
'callback' => 'provision_site_maintenance',
$items['provision/maintenance'] = array(
'title' => 'Site is undergoing maintenance.',
'description' => 'Page shown when a site is being restored or moved etc.',
'page callback' => 'provision_site_maintenance',
'type' => MENU_CALLBACK,
'access' => user_access('access content'),
'access arguments' => array('access content'),
);
$items[] = array(
'path' => 'provision/notfound',
'title' => t('Site not found.'),
'description' => t('The site you have requested is not available.'),
'callback' => 'provision_site_notfound',
$items['provision/notfound'] = array(
'title' => 'Site not found.',
'description' => 'The site you have requested is not available.',
'page callback' => 'provision_site_notfound',
'type' => MENU_CALLBACK,
'access' => user_access('access content'),
'access arguments' => array('access content'),
);
return $items;
}
......
name = Provision: Statistics
description = Generate statistics from a running Drupal site.
package = Provision
dependencies = provision
dependencies[] = provision
core = 6.x
\ No newline at end of file
<?php
// $Id$
function provision_stats_drush_command() {
$items['provision stats'] = array(
'callback' => '_provision_stats',
......@@ -9,7 +8,7 @@ function provision_stats_drush_command() {
return $items;
}
function _provision_stats($url) {
function _provision_stats(&$form_state, $url) {
if (!_provision_drupal_site_installed($url)) {
provision_log("error", "Site has not been installed yet.");
provision_set_error(PROVISION_SITE_NOT_FOUND);
......
name = Provision: Apache
description = Provides provisioning requirements for the Apache Webserver
package = Provision
dependencies = provision
dependencies[] = provision
core = 6.x
\ No newline at end of file
......@@ -14,8 +14,8 @@
/**
* Implementation of hook_help().
*/
function provision_apache_help($section) {
switch ($section) {
function provision_apache_help($path, $arg) {
switch ($path) {
case 'admin/help/provision#requirements':
$output .= _provision_requirements('config_path');
$output .= _provision_requirements('httpd_conf');
......
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