Mercurial > defr > drupal > core
comparison install.php @ 7:fff6d4c8c043 6.3
Drupal 6.3
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:30:28 +0100 |
parents | c1f4ac30525a |
children | acef7ccb09b5 |
comparison
equal
deleted
inserted
replaced
6:2cfdc3c92142 | 7:fff6d4c8c043 |
---|---|
1 <?php | 1 <?php |
2 // $Id: install.php,v 1.113.2.2 2008/02/08 22:00:45 goba Exp $ | 2 // $Id: install.php,v 1.113.2.3 2008/07/09 19:15:59 goba Exp $ |
3 | 3 |
4 require_once './includes/install.inc'; | 4 require_once './includes/install.inc'; |
5 | 5 |
6 define('MAINTENANCE_MODE', 'install'); | 6 define('MAINTENANCE_MODE', 'install'); |
7 | 7 |
96 install_goto("install.php?profile=$profile&locale=$install_locale"); | 96 install_goto("install.php?profile=$profile&locale=$install_locale"); |
97 } | 97 } |
98 | 98 |
99 // Tasks come after the database is set up | 99 // Tasks come after the database is set up |
100 if (!$task) { | 100 if (!$task) { |
101 global $db_url; | |
102 | |
103 if (!$verify && !empty($db_url)) { | |
104 // Do not install over a configured settings.php. | |
105 install_already_done_error(); | |
106 } | |
107 | |
101 // Check the installation requirements for Drupal and this profile. | 108 // Check the installation requirements for Drupal and this profile. |
102 install_check_requirements($profile, $verify); | 109 install_check_requirements($profile, $verify); |
103 | 110 |
104 // Verify existence of all required modules. | 111 // Verify existence of all required modules. |
105 $modules = drupal_verify_profile($profile, $install_locale); | 112 $modules = drupal_verify_profile($profile, $install_locale); |
186 $settings_file = $conf_path .'/settings.php'; | 193 $settings_file = $conf_path .'/settings.php'; |
187 | 194 |
188 // We always need this because we want to run form_get_errors. | 195 // We always need this because we want to run form_get_errors. |
189 include_once './includes/form.inc'; | 196 include_once './includes/form.inc'; |
190 install_task_list('database'); | 197 install_task_list('database'); |
191 | |
192 if ($db_url == 'mysql://username:password@localhost/databasename') { | |
193 $db_user = $db_pass = $db_path = ''; | |
194 } | |
195 elseif (!empty($db_url)) { | |
196 // Do not install over a configured settings.php. | |
197 install_already_done_error(); | |
198 } | |
199 | 198 |
200 $output = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $db_url, $db_type, $db_prefix, $db_user, $db_pass, $db_host, $db_port, $db_path); | 199 $output = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $db_url, $db_type, $db_prefix, $db_user, $db_pass, $db_host, $db_port, $db_path); |
201 drupal_set_title(st('Database configuration')); | 200 drupal_set_title(st('Database configuration')); |
202 print theme('install_page', $output); | 201 print theme('install_page', $output); |
203 exit; | 202 exit; |
867 if (!$verify) { | 866 if (!$verify) { |
868 $writable = FALSE; | 867 $writable = FALSE; |
869 $conf_path = './'. conf_path(FALSE, TRUE); | 868 $conf_path = './'. conf_path(FALSE, TRUE); |
870 $settings_file = $conf_path .'/settings.php'; | 869 $settings_file = $conf_path .'/settings.php'; |
871 $file = $conf_path; | 870 $file = $conf_path; |
871 $exists = FALSE; | |
872 // Verify that the directory exists. | 872 // Verify that the directory exists. |
873 if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) { | 873 if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) { |
874 // Check to see if a settings.php already exists. | 874 // Check to make sure a settings.php already exists. |
875 $file = $settings_file; | |
875 if (drupal_verify_install_file($settings_file, FILE_EXIST)) { | 876 if (drupal_verify_install_file($settings_file, FILE_EXIST)) { |
877 $exists = TRUE; | |
876 // If it does, make sure it is writable. | 878 // If it does, make sure it is writable. |
877 $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE); | 879 $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE); |
878 $file = $settings_file; | 880 } |
879 } | 881 } |
880 else { | 882 if (!$exists) { |
881 // If not, make sure the directory is. | 883 drupal_set_message(st('The @drupal installer requires that you create %file as part of the installation process, and then make it writable. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error'); |
882 $writable = drupal_verify_install_file($conf_path, FILE_READABLE|FILE_WRITABLE, 'dir'); | 884 } |
883 } | 885 elseif (!$writable) { |
884 } | |
885 | |
886 if (!$writable) { | |
887 drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error'); | 886 drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error'); |
888 } | 887 } |
889 } | 888 } |
890 | 889 |
891 // Check the other requirements. | 890 // Check the other requirements. |