removed most of the <?php ?> that was making this hard to read

Conflicts:

	install.php
This commit is contained in:
Brenda Wallace 2009-09-14 19:05:14 +12:00
parent c2e156dc49
commit 20764dc08b

View File

@ -240,17 +240,16 @@ function haveExternalLibrary($external_library)
function checkPrereqs() function checkPrereqs()
{ {
$pass = true; $pass = true;
if (file_exists(INSTALLDIR.'/config.php')) { if (file_exists(INSTALLDIR.'/config.php')) {
?><p class="error">Config file &quot;config.php&quot; already exists.</p> printf('<p class="error">Config file &quot;config.php&quot; already exists.</p>');
<?php
$pass = false; $pass = false;
} }
if (version_compare(PHP_VERSION, '5.2.3', '<')) { if (version_compare(PHP_VERSION, '5.2.3', '<')) {
?><p class="error">Require PHP version 5.2.3 or greater.</p><?php printf('<p class="error">Require PHP version 5.2.3 or greater.</p>');
$pass = false; $pass = false;
} }
$reqs = array('gd', 'curl', $reqs = array('gd', 'curl',
@ -258,11 +257,10 @@ function checkPrereqs()
foreach ($reqs as $req) { foreach ($reqs as $req) {
if (!checkExtension($req)) { if (!checkExtension($req)) {
?><p class="error">Cannot load required extension: <code><?php echo $req; ?></code></p><?php printf('<p class="error">Cannot load required extension: <code>%s</code></p>', $req);
$pass = false; $pass = false;
} }
} }
// Make sure we have at least one database module available // Make sure we have at least one database module available
global $dbModules; global $dbModules;
$missingExtensions = array(); $missingExtensions = array();
@ -273,30 +271,28 @@ function checkPrereqs()
} }
if (count($missingExtensions) == count($dbModules)) { if (count($missingExtensions) == count($dbModules)) {
$req = implode(', ', $missingExtensions); $req = implode(', ', $missingExtensions);
?><p class="error">Cannot find database support. You need at least one of these PHP extensions installed: <code><?php echo $req; ?></code></p><?php printf('<p class="error">Cannot find mysql or pgsql extension. You need one or the other: <code>%s</code></p>', $req);
$pass = false; $pass = false;
} }
if (!is_writable(INSTALLDIR)) { if (!is_writable(INSTALLDIR)) {
?><p class="error">Cannot write config file to: <code><?php echo INSTALLDIR; ?></code></p> printf('<p class="error">Cannot write config file to: <code>%s</code></p>', INSTALLDIR);
<p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?></code> printf('<p>On your server, try this command: <code>chmod a+w %s</code>', INSTALLDIR);
<?php $pass = false;
$pass = false; }
}
// Check the subdirs used for file uploads // Check the subdirs used for file uploads
$fileSubdirs = array('avatar', 'background', 'file'); $fileSubdirs = array('avatar', 'background', 'file');
foreach ($fileSubdirs as $fileSubdir) { foreach ($fileSubdirs as $fileSubdir) {
$fileFullPath = INSTALLDIR."/$fileSubdir/"; $fileFullPath = INSTALLDIR."/$fileSubdir/";
if (!is_writable($fileFullPath)) { if (!is_writable($fileFullPath)) {
?><p class="error">Cannot write <?php echo $fileSubdir; ?> directory: <code><?php echo $fileFullPath; ?></code></p> printf('<p class="error">Cannot write to %s directory: <code>%s</code></p>', $fileSubdir, $fileFullPath);
<p>On your server, try this command: <code>chmod a+w <?php echo $fileFullPath; ?></code></p> printf('<p>On your server, try this command: <code>chmod a+w %s</code></p>', $fileFullPath);
<?php $pass = false;
$pass = false; }
} }
}
return $pass; return $pass;
} }
function checkExtension($name) function checkExtension($name)