diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-12 02:33:53 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-12 02:33:53 +0000 |
commit | ea3785c12697f168aa467133599ae804906705bb (patch) | |
tree | 8ce96f544199c1366b2ea610632529990a75f9d5 /installer/helpers | |
parent | df44265401f7c45ba833335e7b00d477d3e63797 (diff) |
Add a check that the installation directory is writable
Diffstat (limited to 'installer/helpers')
-rw-r--r-- | installer/helpers/installer.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/installer/helpers/installer.php b/installer/helpers/installer.php index 8bc73619..9214060d 100644 --- a/installer/helpers/installer.php +++ b/installer/helpers/installer.php @@ -250,7 +250,7 @@ class installer { public static function check_database_authorization() { $section = array("header" => "Database Configuration", - "description" => "The Gallery3 requires the following database configuration.", + "description" => "Gallery3 requires the following database configuration.", "msgs" => array()); $class = self::$config["type"]; $class = "Install_{$class}_Driver"; @@ -298,6 +298,25 @@ class installer { return $db_config_valid; } + public static function check_docroot_writable() { + $section = array("header" => "File System Access", + "description" => "The requires the following file system configuration.", + "msgs" => array()); + if (is_writable(DOCROOT)) { + $writable = true; + $section["msgs"]["Permissions"] = + array("text" => "The installation directory '" . DOCROOT . "' is writable.", + "error" => false); + } else { + $writable = false; + $section["msgs"]["Permissions"] = + array("text" => "The current user is unable to write to '" . DOCROOT . "'.", + "error" => true); + } + self::$messages[] = $section; + return $writable; + } + private static function _render($view) { if ($view == '') return; |