Add tests to the info page.

This commit is contained in:
Lars Jung 2014-07-03 00:13:54 +02:00
parent 82d3b5040e
commit 30993e40f6
3 changed files with 22 additions and 3 deletions

View File

@ -134,7 +134,7 @@ body#h5ai-info {
margin: 4px 0 12px 12px;
font-size: 0.7em;
color: #aaa;
width: 380px;
width: 460px;
line-height: 1.2em;
}
}

View File

@ -46,6 +46,21 @@ modulejs.define('info', ['$', 'config'], function ($, config) {
$(testsTemp).appendTo('body');
addTest(
'Index file found', 'Add <code>' + setup.INDEX_HREF + '</code> to your index file list',
setup.INDEX_HREF
);
addTest(
'Options parsable', 'File <code>options.json</code> is readable and syntax seams to be correct',
config.options !== null
);
addTest(
'Types parsable', 'File <code>types.json</code> is readable and syntax seams to be correct',
config.types !== null
);
addTest(
'Server software', 'Server is one of apache, lighttpd, nginx or cherokee',
setup.HAS_SERVER, setup.SERVER_NAME + ' ' + setup.SERVER_VERSION

View File

@ -72,9 +72,13 @@ function setup() {
define("CURRENT_HREF", $current_href);
define("CURRENT_PATH", $current_path);
define("INDEX_HREF", normalize_path(APP_HREF . "server/php/index.php", false));
$index_href = null;
if (@is_readable(normalize_path(APP_PATH . "/server/php/index.php", false))) {
$index_href = normalize_path(APP_HREF . "/server/php/index.php", false);
}
define("INDEX_HREF", $index_href);
define("CACHE_HREF", normalize_path(APP_HREF . "cache", true));
define("CACHE_HREF", normalize_path(APP_HREF . "/cache", true));
define("CACHE_PATH", normalize_path(APP_PATH . "/cache", false));
define("HAS_WRITABLE_CACHE", @is_writable(CACHE_PATH));