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 | |
parent | df44265401f7c45ba833335e7b00d477d3e63797 (diff) |
Add a check that the installation directory is writable
-rw-r--r-- | installer/helpers/installer.php | 21 | ||||
-rw-r--r-- | installer/install.php | 2 |
2 files changed, 22 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; diff --git a/installer/install.php b/installer/install.php index 694ae2a1..9ed20d6d 100644 --- a/installer/install.php +++ b/installer/install.php @@ -93,6 +93,8 @@ try { die("Specifed User does not have sufficient authority to install Gallery3\n"); } +$config_valid = installer::check_docroot_writable(); + installer::display_requirements(!$config_valid); if ($config_valid) { |