From ea3785c12697f168aa467133599ae804906705bb Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 12 Jan 2009 02:33:53 +0000 Subject: Add a check that the installation directory is writable --- installer/helpers/installer.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'installer/helpers') 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; -- cgit v1.2.3