Almost fixed checkconfig.

This commit is contained in:
Sébastien Lucas 2013-05-16 14:41:24 +02:00
parent 1a9eeeaa59
commit 9a2edbce70

View file

@ -10,7 +10,7 @@
require_once ("config.php"); require_once ("config.php");
require_once ("base.php"); require_once ("base.php");
header ("Content-Type:application/xhtml+xml"); header ("Content-Type:text/html; charset=UTF-8");
$err = getURLParam ("err", -1); $err = getURLParam ("err", -1);
$error = NULL; $error = NULL;
@ -21,38 +21,35 @@
} }
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" /> <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
<title>COPS Configuration Check</title> <title>COPS Configuration Check</title>
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("style.css") ?>" media="screen" /> <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("style.css") ?>" media="screen" />
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="head"> <header>
<div class="headcenter"> <div class="headcenter">
<p>COPS Configuration Check</p> <h1>COPS Configuration Check</h1>
</div> </div>
</div> </header>
<div class="clearer" />
<div id="content" style="display: none;"></div> <div id="content" style="display: none;"></div>
<div class="entries"> <section>
<?php <?php
if (!is_null ($error)) { if (!is_null ($error)) {
?> ?>
<div class="entry"> <article class="frontpage">
<div class="entryTitle">You've been redirected because COPS is not configured properly</div> <h2>You've been redirected because COPS is not configured properly</h2>
<div class="entryContent"><?php echo $error ?></div> <h4><?php echo $error ?></h4>
</div> </article>
<?php <?php
} }
?> ?>
<div class="entry"> <article class="frontpage">
<div class="entryTitle">Check if GD is properly installed and loaded</div> <h2>Check if GD is properly installed and loaded</h2>
<div class="entryContent"> <h4>
<?php <?php
if (extension_loaded('gd') && function_exists('gd_info')) { if (extension_loaded('gd') && function_exists('gd_info')) {
echo "OK"; echo "OK";
@ -60,11 +57,11 @@
echo "Please install the php5-gd extension and make sure it's enabled"; echo "Please install the php5-gd extension and make sure it's enabled";
} }
?> ?>
</div> </h4>
</div> </article>
<div class="entry"> <article class="frontpage">
<div class="entryTitle">Check if Sqlite is properly installed and loaded</div> <h2>Check if Sqlite is properly installed and loaded</h2>
<div class="entryContent"> <h4>
<?php <?php
if (extension_loaded('pdo_sqlite')) { if (extension_loaded('pdo_sqlite')) {
echo "OK"; echo "OK";
@ -72,11 +69,11 @@
echo "Please install the php5-sqlite extension and make sure it's enabled"; echo "Please install the php5-sqlite extension and make sure it's enabled";
} }
?> ?>
</div> </h4>
</div> </article>
<div class="entry"> <article class="frontpage">
<div class="entryTitle">Check if libxml is properly installed and loaded</div> <h2>Check if libxml is properly installed and loaded</h2>
<div class="entryContent"> <h4>
<?php <?php
if (extension_loaded('libxml')) { if (extension_loaded('libxml')) {
echo "OK"; echo "OK";
@ -84,15 +81,14 @@
echo "Please make sure libxml is enabled"; echo "Please make sure libxml is enabled";
} }
?> ?>
</div> </h4>
</div> </article>
<?php <?php
$i = 0; $i = 0;
foreach (Base::getDbList () as $name => $database) { foreach (Base::getDbList () as $name => $database) {
?> ?>
<div class="entry"> <article class="frontpage">
<div class="entryTitle">Check if Calibre database file exists and is readable</div> <h2>Check if Calibre database file exists and is readable</h2>
<div class="entryContent">
<?php <?php
if (is_readable (Base::getDbFileName ($i))) { if (is_readable (Base::getDbFileName ($i))) {
echo "{$name} OK"; echo "{$name} OK";
@ -107,11 +103,10 @@ Please check
</ul>"; </ul>";
} }
?> ?>
</div> </article>
</div> <article class="frontpage">
<div class="entry"> <h2>Check if Calibre database file can be opened with PHP</h2>
<div class="entryTitle">Check if Calibre database file can be opened with PHP</div> <h4>
<div class="entryContent">
<?php <?php
try { try {
$db = new PDO('sqlite:'. Base::getDbFileName ($i)); $db = new PDO('sqlite:'. Base::getDbFileName ($i));
@ -120,11 +115,11 @@ Please check
echo "{$name} If the file is readable, check your php configuration. Exception detail : " . $e; echo "{$name} If the file is readable, check your php configuration. Exception detail : " . $e;
} }
?> ?>
</div> </h4>
</div> </article>
<div class="entry"> <article class="frontpage">
<div class="entryTitle">Check if Calibre database file contains at least some of the needed tables</div> <h2>Check if Calibre database file contains at least some of the needed tables</h2>
<div class="entryContent"> <h4>
<?php <?php
try { try {
$db = new PDO('sqlite:'. Base::getDbFileName ($i)); $db = new PDO('sqlite:'. Base::getDbFileName ($i));
@ -138,10 +133,10 @@ Please check
echo "{$name} If the file is readable, check your php configuration. Exception detail : " . $e; echo "{$name} If the file is readable, check your php configuration. Exception detail : " . $e;
} }
?> ?>
</div> </h4>
</div> </article>
<?php $i++; } ?> <?php $i++; } ?>
</div> </section>
</div> </div>
</body> </body>
</html> </html>