Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.219 diff -u -p -r1.219 install.php --- install.php 16 Oct 2009 19:06:21 -0000 1.219 +++ install.php 20 Oct 2009 04:50:37 -0000 @@ -1499,39 +1499,43 @@ function install_check_requirements($ins $writable = FALSE; $conf_path = './' . conf_path(FALSE, TRUE); $settings_file = $conf_path . '/settings.php'; - $file = $conf_path; + $temporary_settings_file = './sites/default/temporary.settings.php'; $exists = FALSE; - // Verify that the directory exists. - if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) { - // Check to make sure a settings.php already exists. - $file = $settings_file; - if (drupal_verify_install_file($settings_file, FILE_EXIST)) { - $exists = TRUE; - // If it does, make sure it is writable. - $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE); + // Check if a settings.php file already exists and is writable. + if (drupal_verify_install_file($settings_file, FILE_EXIST)) { + $exists = TRUE; + $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE); + } + // If a settings.php file doesn't already exist, try to move the temporary + // settings file to create one. + else { + if (drupal_verify_install_file($conf_path, FILE_EXIST|FILE_WRITABLE, 'dir') && drupal_verify_install_file($temporary_settings_file, FILE_EXIST|FILE_WRITABLE) && @rename($temporary_settings_file, $settings_file)) { $exists = TRUE; + $writable = TRUE; } } if (!$exists) { - $requirements['settings file exists'] = array( - 'title' => st('Settings file'), - 'value' => st('The settings file does not exist.'), - 'severity' => REQUIREMENT_ERROR, - 'description' => st('The @drupal installer requires that you create a settings file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in INSTALL.txt.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path . '/default.settings.php', '@install_txt' => base_path() . 'INSTALL.txt')), - ); + if (!$writable) { + $requirements['settings file'] = array( + 'title' => st('Directory and file permissions'), + 'value' => st('Not set correctly.'), + 'severity' => REQUIREMENT_ERROR, + 'description' => st('The @drupal installer requires write permissions to the %directory directory and the %file file during the installation process. If you are unsure how to grant file permissions, consult the online handbook. More details about installing Drupal are available in INSTALL.txt.', array('@drupal' => drupal_install_profile_name(), '%directory' => $conf_path, '%file' => $temporary_settings_file, '@handbook_url' => 'http://drupal.org/server-permissions', '@install_txt' => base_path() . 'INSTALL.txt')), + ); + } } else { $requirements['settings file exists'] = array( 'title' => st('Settings file'), - 'value' => st('The %file file exists.', array('%file' => $file)), + 'value' => st('The %file file exists.', array('%file' => $settings_file)), ); if (!$writable) { $requirements['settings file writable'] = array( 'title' => st('Settings file'), 'value' => st('The settings file is not writable.'), 'severity' => REQUIREMENT_ERROR, - 'description' => st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, consult the online handbook.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), + 'description' => st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, consult the online handbook.', array('@drupal' => drupal_install_profile_name(), '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/server-permissions')), ); } else { Index: sites/default/temporary.settings.php =================================================================== RCS file: sites/default/temporary.settings.php diff -N sites/default/temporary.settings.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/default/temporary.settings.php 20 Oct 2009 04:50:37 -0000 @@ -0,0 +1,10 @@ +