summaryrefslogtreecommitdiff
path: root/install.php
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-09-01 08:44:53 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-09-01 08:44:53 +0000
commitdd4f143df621bb926934335c4fdf44f8267f6039 (patch)
tree24cecf862de66f9dd6bd7b272ae8fe00c349c834 /install.php
parent246334f30d63a468dcb564703b4ca27a4c22d3d3 (diff)
downloadbrdo-dd4f143df621bb926934335c4fdf44f8267f6039.tar.gz
brdo-dd4f143df621bb926934335c4fdf44f8267f6039.tar.bz2
#75002: Install-time and run-time requirements checking + status report page
Diffstat (limited to 'install.php')
-rw-r--r--install.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/install.php b/install.php
index 166e9f212..48cec04c0 100644
--- a/install.php
+++ b/install.php
@@ -28,7 +28,6 @@ function install_main() {
// Establish a connection to the database.
require_once './includes/database.inc';
db_set_active();
-
// Check if Drupal is installed.
if (install_verify_drupal()) {
install_already_done_error();
@@ -70,6 +69,9 @@ function install_main() {
install_change_settings();
}
+ // Check the installation requirements for Drupal and this profile.
+ install_check_requirements($profile);
+
// Perform actual installation defined in the profile.
$modules = drupal_verify_profile($profile, $install_locale);
drupal_install_profile($profile, $modules);
@@ -513,4 +515,27 @@ function install_complete($profile) {
print theme('maintenance_page', $output);
}
+/**
+ * Page to check installation requirements and report any errors.
+ */
+function install_check_requirements($profile) {
+ $requirements = drupal_check_profile($profile);
+ $severity = drupal_requirements_severity($requirements);
+
+ // If there are issues, report them.
+ if ($severity == REQUIREMENT_ERROR) {
+ drupal_maintenance_theme();
+
+ foreach ($requirements as $requirement) {
+ if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {
+ drupal_set_message($requirement['description'] .' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')', 'error');
+ }
+ }
+
+ drupal_set_title('Incompatible environment');
+ print theme('install_page', '');
+ exit;
+ }
+}
+
install_main();