From 9b2bf38e836632e0395cd2673fc397dfcccc4630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 27 Dec 2007 17:25:28 +0000 Subject: #194369 by lots of contributors: move default files directory to sites/default/files which can be created automatically on install, so no need to bug the user about it, making the install process easier --- modules/system/system.install | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/system/system.install') diff --git a/modules/system/system.install b/modules/system/system.install index c23bfddee..980524561 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -151,6 +151,12 @@ function system_requirements($phase) { // Test files directory $directory = file_directory_path(); + + // For installer, create the directory if possible. + if ($phase == 'install' && !is_dir($directory) && @mkdir($directory)) { + @chmod($directory, 0775); // Necessary for non-webserver users. + } + $is_writable = is_writable($directory); $is_directory = is_dir($directory); if (!$is_writable || !$is_directory) { @@ -170,7 +176,7 @@ function system_requirements($phase) { 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 ensure that the files directory exists and is writable by the installer. If you are unsure how to create this directory and modify its permissions, please consult the on-line handbook or INSTALL.txt.', array('%directory' => $directory, '@handbook_url' => 'http://drupal.org/server-permissions')); + $requirements['file system']['description'] = $error .' '. $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually, or ensure that the installer has the permissions to create it automatically. For more information, please see INSTALL.txt or the on-line handbook.', array('@handbook_url' => 'http://drupal.org/server-permissions')); $requirements['file system']['value'] = ''; } } -- cgit v1.2.3