diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-12-12 09:29:43 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-12-12 09:29:43 +0000 |
commit | 4a95d629589c13aa4b8f47abe295de344d3b8d42 (patch) | |
tree | a70af41ef421d18e4be357f09e0f5c9e36cb28d1 | |
parent | a10ca909a0f0f6dbead4401c006b81fee24b68e4 (diff) | |
download | brdo-4a95d629589c13aa4b8f47abe295de344d3b8d42.tar.gz brdo-4a95d629589c13aa4b8f47abe295de344d3b8d42.tar.bz2 |
#101133: Add files directory writability to status report.
-rw-r--r-- | modules/system/system.install | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index 42c4728a9..475613d7c 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -106,6 +106,39 @@ function system_requirements($phase) { $requirements['cron']['title'] = $t('Cron maintenance tasks'); } + // Test files directory + 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'))), + ); + } + else { + 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)'), + ); + } + } + $requirements['file system']['title'] = $t('File system'); + } + // See if updates are available in update.php. if ($phase == 'runtime') { $requirements['update'] = array( |