? files
? files_dir_mandatory_4.patch
? files_dir_mandatory_5.patch
? sites/all/modules
? sites/default/settings.php
Index: INSTALL.txt
===================================================================
RCS file: /cvs/drupal/drupal/INSTALL.txt,v
retrieving revision 1.45
diff -r1.45 INSTALL.txt
65c65
< 2. GIVE PERMISSION TO DRUPAL TO BE ABLE TO CREATE THE CONFIGURATION FILE
---
> 2. GRANT WRITE PERMISSIONS ON CONFIGURATION FILE AND FILES STORAGE DIRECTORY
70,71c70,71
<    directory. For Drupal to be able to create the file, you need to
<    give the web server write privileges to the sites/default directory:
---
>    directory. Give the web server write privileges to the sites/default
>    directory with the command (from the installation directory):
73c73,80
<      chmod o+w default
---
>      chmod o+w sites/default
> 
>    Drupal requires the files directory be present and writable during
>    the installation (the location of the files directory can be changed
>    after Drupal is installed). Give the web server write privileges to the
>    files directory with the command (from the installation directory):
> 
>      chmod o+w files
118,124c125,131
<    Consider creating a "files" subdirectory in your Drupal installation
<    directory. This subdirectory stores files such as custom logos, user avatars,
<    and other media associated with your new site. The sub-directory requires
<    "read and write" permission by the Drupal server process. You can change
<    the name of this subdirectory at "administer > site configuration > file
<    system".
< 
---
>    Determine whether the default "files" directory is the right location for your
>    file system path. Drupal uses the location specified in the file system path
>    to store files attached to site content, theme-specific logos, user avatars, and
>    some temporary files. On some installations, it may be necessary to modify
>    the file system path, especially in large or multi-site configurations. See the
>    files/README.txt file for more information about setting the file system path.
>    
228a236,238
> For more information on configuring Drupal's file system path in a multi-site
> configuration, see files/README.txt.
> 
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.88
diff -r1.88 install.php
94c94
<     install_check_requirements($profile);
---
>     install_check_requirements($profile, $verify);
98,99c98,106
<     if (!$modules) {
<       install_missing_modules_error($profile);
---
> 
>     // If any error messages are set now, it means a requirement problem.
>     $messages = drupal_set_message();
>     if (!empty($messages['error'])) {
>       drupal_maintenance_theme();
>       install_task_list('requirements');
>       drupal_set_title(st('Requirements problem'));
>       print theme('install_page', '');
>       exit;
185,210d191
<   // The existing database settings are not working, so we need write access
<   // to settings.php to change them.
<   $writable = FALSE;
<   $file = $conf_path;
<   // Verify the directory exists.
<   if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
<     // Check to see if a settings.php already exists
<     if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
<       // If it does, make sure it is writable
<       $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
<       $file = $settings_file;
<     }
<     else {
<       // If not, makes sure the directory is.
<       $writable = drupal_verify_install_file($conf_path, FILE_READABLE|FILE_WRITABLE, 'dir');
<     }
<   }
< 
<   if (!$writable) {
<     drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process.', array('@drupal' => drupal_install_profile_name(), '%file' => $file)), 'error');
< 
<     drupal_set_title(st('Drupal database setup'));
<     print theme('install_page', '');
<     exit;
<   }
< 
611,623d591
<  * Show an error page when Drupal is missing required modules.
<  */
< function install_missing_modules_error($profile) {
<   global $base_url;
< 
<   drupal_maintenance_theme();
<   install_task_list('requirements');
<   drupal_set_title(st('Modules missing'));
<   print theme('install_page', '<p>'. st('One or more required modules are missing.') .'</p>');
<   exit;
< }
< 
< /**
767c735
<  * Page to check installation requirements and report any errors.
---
>  * Check installation requirements and report any errors.
769c737
< function install_check_requirements($profile) {
---
> function install_check_requirements($profile, $verify) {
775,776d742
<     drupal_maintenance_theme();
<     install_task_list('requirements');
780c746,750
<         drupal_set_message($requirement['description'] .' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')', 'error');
---
>         $message = $requirement['description'];
>         if ($requirement['value']) {
>           $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')';
>         }
>         drupal_set_message($message, 'error');
782a753
>   }
784,786c755,779
<     drupal_set_title(st('Incompatible environment'));
<     print theme('install_page', '');
<     exit;
---
>   // If the existing database settings are not working, we need also
>   // write access to settings.php to change them.
>   if (!$verify) {
> 
>     $writable = FALSE;
>     $conf_path = './'. conf_path();
>     $settings_file = $conf_path .'/settings.php';
>     $file = $conf_path;
>     // Verify the directory exists.
>     if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
>       // Check to see if a settings.php already exists
>       if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
>         // If it does, make sure it is writable
>         $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
>         $file = $settings_file;
>       }
>       else {
>         // If not, makes sure the directory is.
>         $writable = drupal_verify_install_file($conf_path, FILE_READABLE|FILE_WRITABLE, 'dir');
>       }
>     }
> 
>     if (!$writable) {
>       drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process.', array('@drupal' => drupal_install_profile_name(), '%file' => $file)), 'error');
>     }
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.176
diff -r1.176 system.install
114,129c114,119
<   if ($phase == 'runtime') {
<     $directory = file_directory_path();
<     $is_writable = is_writable($directory);
<     $is_directory = is_dir($directory);
<     if (!$is_writable || !$is_directory) {
<       if (!$is_directory) {
<         $error = $t('The directory %directory does not exist.', array('%directory' => $directory));
<       }
<       else {
<         $error = $t('The directory %directory is not writable.', array('%directory' => $directory));
<       }
<       $requirements['file system'] = array(
<         'value' => $t('Not writable'),
<         'severity' => REQUIREMENT_ERROR,
<         'description' => $error .' '. $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/settings/file-system'))),
<       );
---
>   $directory = file_directory_path();
>   $is_writable = is_writable($directory);
>   $is_directory = is_dir($directory);
>   if (!$is_writable || !$is_directory) {
>     if (!$is_directory) {
>       $error = $t('The directory %directory does not exist.', array('%directory' => $directory));
132,141c122,143
<       if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
<         $requirements['file system'] = array(
<           'value' => $t('Writable (<em>public</em> download method)'),
<         );
<       }
<       else {
<         $requirements['file system'] = array(
<           'value' => $t('Writable (<em>private</em> download method)'),
<         );
<       }
---
>       $error = $t('The directory %directory is not writable.', array('%directory' => $directory));
>     }
>     $requirements['file system'] = array(
>       'value' => $t('Not writable'),
>       'severity' => REQUIREMENT_ERROR,
>     );
>     if ($phase == 'runtime') {
>       $requirements['file system']['description'] = $error .' '. $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/settings/file-system')));
>     }
>     else if ($phase == 'install') {
>       // For the installer UI, we need different wording. 'value' will
>       // be treated as version, so provide none there.
>       $requirements['file system']['description'] = $error .' '. $t("To proceed with the installation, please change the %directory directory permissions to allow the installer to write to it.", array('%directory' => $directory));
>       $requirements['file system']['value'] = '';
>     }
>   }
>   else {
>     if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
>       $requirements['file system']['value'] = $t('Writable (<em>public</em> download method)');
>     }
>     else {
>       $requirements['file system']['value'] = $t('Writable (<em>private</em> download method)');
143d144
<     $requirements['file system']['title'] = $t('File system');
144a146
>   $requirements['file system']['title'] = $t('File system');
diff -urpN --strip-trailing-cr ../drupal-6.x-dev/files/README.txt ./files/README.txt
--- ../drupal-6.x-dev/files/README.txt	1970-01-01 01:00:00.000000000 +0100
+++ ./files/README.txt	2007-11-12 23:28:59.000000000 +0100
@@ -0,0 +1,26 @@
+// $Id$
+
+The files directory is the default file system path used to store
+all uploaded files, as well as some temporary files created by Drupal.
+
+If you wish to store uploaded files in a different location, modify
+the settings for the file system path, to point to your newly created
+directory. Once you have installed Drupal, the settings may be found
+at:
+
+  administer > site configuration > file system
+
+If your site runs multiple Drupal installations from a single codebase,
+you may wish to set the file system path of each installation
+to a different directory so that uploads do not overlap.
+
+Changing the file system path after files have been uploaded may cause
+unexpected problems on an existing site. If you modify the file system path
+on an existing site, remember to copy all files from this directory to the
+new location.
+
+This directory may be removed if the file system path has been modified
+to point to another location.
+
+You must ensure that files directory is always writable for the server
+process, to successfully install and use Drupal.
