From 20764dc08b0231e4be07c4e181c8603b005c20b5 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 14 Sep 2009 19:05:14 +1200 Subject: removed most of the that was making this hard to read Conflicts: install.php --- install.php | 58 +++++++++++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index 221e4746f..6f8bff91e 100644 --- a/install.php +++ b/install.php @@ -240,17 +240,16 @@ function haveExternalLibrary($external_library) function checkPrereqs() { - $pass = true; + $pass = true; if (file_exists(INSTALLDIR.'/config.php')) { - ?>

Config file "config.php" already exists.

- Config file "config.php" already exists.

'); $pass = false; } if (version_compare(PHP_VERSION, '5.2.3', '<')) { - ?>

Require PHP version 5.2.3 or greater.

Require PHP version 5.2.3 or greater.

'); + $pass = false; } $reqs = array('gd', 'curl', @@ -258,11 +257,10 @@ function checkPrereqs() foreach ($reqs as $req) { if (!checkExtension($req)) { - ?>

Cannot load required extension:

Cannot load required extension: %s

', $req); + $pass = false; } - } - + } // Make sure we have at least one database module available global $dbModules; $missingExtensions = array(); @@ -273,30 +271,28 @@ function checkPrereqs() } if (count($missingExtensions) == count($dbModules)) { $req = implode(', ', $missingExtensions); - ?>

Cannot find database support. You need at least one of these PHP extensions installed:

Cannot find mysql or pgsql extension. You need one or the other: %s

', $req); + $pass = false; + } + + if (!is_writable(INSTALLDIR)) { + printf('

Cannot write config file to: %s

', INSTALLDIR); + printf('

On your server, try this command: chmod a+w %s', INSTALLDIR); + $pass = false; + } + + // Check the subdirs used for file uploads + $fileSubdirs = array('avatar', 'background', 'file'); + foreach ($fileSubdirs as $fileSubdir) { + $fileFullPath = INSTALLDIR."/$fileSubdir/"; + if (!is_writable($fileFullPath)) { + printf('

Cannot write to %s directory: %s

', $fileSubdir, $fileFullPath); + printf('

On your server, try this command: chmod a+w %s

', $fileFullPath); + $pass = false; + } } - if (!is_writable(INSTALLDIR)) { - ?>

Cannot write config file to:

-

On your server, try this command: chmod a+w -

Cannot write directory:

-

On your server, try this command: chmod a+w

-