summaryrefslogtreecommitdiff
path: root/install.php
diff options
context:
space:
mode:
Diffstat (limited to 'install.php')
-rw-r--r--install.php55
1 files changed, 30 insertions, 25 deletions
diff --git a/install.php b/install.php
index faf909a6c..a68b47699 100644
--- a/install.php
+++ b/install.php
@@ -1,7 +1,12 @@
<?php
// $Id$
-require_once './includes/install.inc';
+/**
+ * Root directory of Drupal installation.
+ */
+define('DRUPAL_ROOT', dirname(realpath(__FILE__)));
+
+require_once DRUPAL_ROOT . '/includes/install.inc';
/**
* Global flag to indicate that site is in installation mode.
@@ -28,14 +33,14 @@ function install_main() {
exit;
}
- require_once './includes/bootstrap.inc';
+ require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
// This must go after drupal_bootstrap(), which unsets globals!
global $profile, $install_locale, $conf;
- require_once './modules/system/system.install';
- require_once './includes/file.inc';
+ require_once DRUPAL_ROOT . '/modules/system/system.install';
+ require_once DRUPAL_ROOT . '/includes/file.inc';
// Ensure correct page headers are sent (e.g. caching)
drupal_page_header();
@@ -44,7 +49,7 @@ function install_main() {
drupal_init_language();
// Load module basics (needed for hook invokes).
- include_once './includes/module.inc';
+ include_once DRUPAL_ROOT . '/includes/module.inc';
$module_list['system']['filename'] = 'modules/system/system.module';
$module_list['filter']['filename'] = 'modules/filter/filter.module';
module_list(TRUE, FALSE, FALSE, $module_list);
@@ -61,12 +66,12 @@ function install_main() {
// Since we have a database connection, we use the normal cache system.
// This is important, as the installer calls into the Drupal system for
// the clean URL checks, so we should maintain the cache properly.
- require_once './includes/cache.inc';
- $conf['cache_inc'] = './includes/cache.inc';
+ require_once DRUPAL_ROOT . '/includes/cache.inc';
+ $conf['cache_inc'] = 'includes/cache.inc';
// Initialize the database system. Note that the connection
// won't be initialized until it is actually requested.
- require_once './includes/database/database.inc';
+ require_once DRUPAL_ROOT . '/includes/database/database.inc';
// Check if Drupal is installed.
$task = install_verify_drupal();
@@ -79,8 +84,8 @@ function install_main() {
// for cached data will fail, we temporarily replace the normal cache
// system with a stubbed-out version that short-circuits the actual
// caching process and avoids any errors.
- require_once './includes/cache-install.inc';
- $conf['cache_inc'] = './includes/cache-install.inc';
+ require_once DRUPAL_ROOT . '/includes/cache-install.inc';
+ $conf['cache_inc'] = 'includes/cache-install.inc';
$task = NULL;
}
@@ -97,7 +102,7 @@ function install_main() {
}
// Load the profile.
- require_once "./profiles/$profile/$profile.profile";
+ require_once DRUPAL_ROOT . "/profiles/$profile/$profile.profile";
// Locale selection
if (!empty($_GET['locale'])) {
@@ -172,7 +177,7 @@ function install_verify_settings() {
// Verify existing settings (if any).
if (!empty($databases)) {
// We need this because we want to run form_get_errors.
- include_once './includes/form.inc';
+ include_once DRUPAL_ROOT . '/includes/form.inc';
$database = $databases['default']['default'];
$settings_file = './' . conf_path(FALSE, TRUE) . '/settings.php';
@@ -197,7 +202,7 @@ function install_change_settings($profile = 'default', $install_locale = '') {
$database = isset($databases['default']['default']) ? $databases['default']['default'] : array();
// We always need this because we want to run form_get_errors.
- include_once './includes/form.inc';
+ include_once DRUPAL_ROOT . '/includes/form.inc';
install_task_list('database');
$output = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $database);
@@ -411,7 +416,7 @@ function install_find_profiles() {
* The selected profile.
*/
function install_select_profile() {
- include_once './includes/form.inc';
+ include_once DRUPAL_ROOT . '/includes/form.inc';
$profiles = install_find_profiles();
// Don't need to choose profile if only one available.
@@ -448,7 +453,7 @@ function install_select_profile_form(&$form_state, $profile_files) {
$names = array();
foreach ($profile_files as $profile) {
- include_once($profile->filename);
+ include_once DRUPAL_ROOT . '/' . $profile->filename;
// Load profile details and store them for later retrieval.
$function = $profile->name . '_profile_details';
@@ -499,8 +504,8 @@ function install_find_locales($profilename) {
* The selected language.
*/
function install_select_locale($profilename) {
- include_once './includes/file.inc';
- include_once './includes/form.inc';
+ include_once DRUPAL_ROOT . '/includes/file.inc';
+ include_once DRUPAL_ROOT . '/includes/form.inc';
// Find all available locales.
$locales = install_find_locales($profilename);
@@ -564,7 +569,7 @@ function install_select_locale($profilename) {
* Form API array definition for language selection.
*/
function install_select_locale_form(&$form_state, $locales) {
- include_once './includes/locale.inc';
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
$languages = _locale_get_predefined_list();
foreach ($locales as $locale) {
// Try to use verbose locale name
@@ -660,14 +665,14 @@ function install_tasks($profile, $task) {
// to the same address, until the batch finished callback is invoked
// and the task advances to 'locale-initial-import'.
if ($task == 'profile-install-batch') {
- include_once 'includes/batch.inc';
+ include_once DRUPAL_ROOT .'/includes/batch.inc';
$output = _batch_page();
}
// Import interface translations for the enabled modules.
if ($task == 'locale-initial-import') {
if (!empty($install_locale) && ($install_locale != 'en')) {
- include_once 'includes/locale.inc';
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
// Enable installation language as default site language.
locale_add_language($install_locale, NULL, NULL, NULL, NULL, NULL, 1, TRUE);
// Collect files to import for this language.
@@ -686,8 +691,8 @@ function install_tasks($profile, $task) {
$task = 'configure';
}
if ($task == 'locale-initial-batch') {
- include_once 'includes/batch.inc';
- include_once 'includes/locale.inc';
+ include_once DRUPAL_ROOT . '/includes/batch.inc';
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
$output = _batch_page();
}
@@ -771,7 +776,7 @@ if (Drupal.jsEnabled) {
// control and proceed with importing the remaining translations.
if ($task == 'profile-finished') {
if (!empty($install_locale) && ($install_locale != 'en')) {
- include_once 'includes/locale.inc';
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
// Collect files to import for this language. Skip components
// already covered in the initial batch set.
$batch = locale_batch_by_language($install_locale, '_install_locale_remaining_batch_finished', variable_get('install_locale_batch_components', array()));
@@ -789,8 +794,8 @@ if (Drupal.jsEnabled) {
$task = 'finished';
}
if ($task == 'locale-remaining-batch') {
- include_once 'includes/batch.inc';
- include_once 'includes/locale.inc';
+ include_once DRUPAL_ROOT . '/includes/batch.inc';
+ include_once DRUPAL_ROOT . '/includes/locale.inc';
$output = _batch_page();
}