From 1c75a210bdf85afeee33952fd50c1951999fecb4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 13 Jul 2006 13:14:25 +0000 Subject: - Patch #68926 by chx, jeremy, steven, eaton, webchick, amazon, neil, nedjo et al: an initial install system for Drupal core. --- includes/bootstrap.inc | 21 ++- includes/database.mysql.inc | 3 +- includes/database.mysqli.inc | 3 +- includes/database.pgsql.inc | 3 +- includes/install.inc | 435 ++++++++++++++++++++++++++++++++++++++++++- includes/install.mysql.inc | 140 ++++++++++++++ includes/install.mysqli.inc | 140 ++++++++++++++ includes/module.inc | 41 ++-- includes/theme.inc | 74 ++++++-- 9 files changed, 809 insertions(+), 51 deletions(-) create mode 100644 includes/install.mysql.inc create mode 100644 includes/install.mysqli.inc (limited to 'includes') diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index ba7ab0a03..1c68b1398 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -151,9 +151,9 @@ function drupal_unset_globals() { * Loads the configuration and sets the base URL correctly. */ function conf_init() { - global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf; + global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf, $installed_profile; $conf = array(); - require_once './'. conf_path() .'/settings.php'; + include_once './'. conf_path() .'/settings.php'; if (isset($base_url)) { // Parse fixed base URL from settings.php. @@ -565,14 +565,21 @@ function drupal_set_message($message = NULL, $type = 'status') { /** * Return all messages that have been set. * - * As a side effect, this function clears the message queue. + * @param $type + * (optional) Only return messages of this type. */ -function drupal_get_messages() { +function drupal_get_messages($type = NULL) { if ($messages = drupal_set_message()) { - unset($_SESSION['messages']); + if ($type) { + unset($_SESSION['messages'][$type]); + return array($type => $messages[$type]); + } + else { + unset($_SESSION['messages']); + return $messages; + } } - - return $messages; + return array(); } /** diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 18b2ca772..0326bd508 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -53,7 +53,8 @@ function db_connect($url) { if (!$connection) { drupal_maintenance_theme(); drupal_set_title('Unable to connect to database server'); - print theme('maintenance_page', '

This either means that the username and password information in your settings.php file is incorrect or we can\'t contact the MySQL database server. This could mean your hosting provider\'s database server is down.

+ print theme('maintenance_page', '

If you still have to install Drupal, proceed to the installation page.

+

If you have already finished installed Drupal, this either means that the username and password information in your settings.php file is incorrect or that we can\'t connect to the MySQL database server. This could mean your hosting provider\'s database server is down.

The MySQL error was: '. theme('placeholder', mysql_error()) .'.

Currently, the username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.