diff --git a/src/_h5ai/client/js/inc/main/info.js b/src/_h5ai/client/js/inc/main/info.js index be8cd981..741b77ef 100644 --- a/src/_h5ai/client/js/inc/main/info.js +++ b/src/_h5ai/client/js/inc/main/info.js @@ -162,6 +162,12 @@ modulejs.define('main/info', ['$', 'config'], function ($, config) { function init() { + if (config.err === 'ERR_PHP') { + $(testsTemp).appendTo('#content'); + addTest('PHP version', config.msg, false, config.ver); + return; + } + addLogin(); if (setup.AS_ADMIN) { addTests(); diff --git a/src/_h5ai/server/php/config.php b/src/_h5ai/server/php/config.php new file mode 100644 index 00000000..bc7ad83a --- /dev/null +++ b/src/_h5ai/server/php/config.php @@ -0,0 +1,8 @@ +apply(); } else { define("FALLBACK", $app->get_fallback()); - normalized_require_once("page"); + normalized_require_once("inc/page"); } } @@ -30,8 +30,6 @@ class Bootstrap { setlocale(LC_CTYPE, "en_US.UTF-8"); date_default_timezone_set(@date_default_timezone_get()); - define("MIN_PHP_VERSION", "5.4.0"); - define("HAS_MIN_PHP_VERSION", version_compare(PHP_VERSION, MIN_PHP_VERSION) >= 0); define("HAS_PHP_EXIF", function_exists("exif_thumbnail")); $has_php_jpeg = false; if (function_exists("gd_info")) { diff --git a/src/_h5ai/server/php/index.php b/src/_h5ai/server/php/index.php index 3602c08d..ffce0994 100644 --- a/src/_h5ai/server/php/index.php +++ b/src/_h5ai/server/php/index.php @@ -1,24 +1,27 @@ = 0); - -/********************************************************************* - SHA1 hash of the info page password, the preset password is the - empty string. You might change it to keep this information private. - Online hash generator: http://www.sha1.cz/ -*********************************************************************/ -define("PASSHASH", "da39a3ee5e6b4b0d3255bfef95601890afd80709"); - - +if (!HAS_MIN_PHP_VERSION) { + header("Content-type: application/json;charset=utf-8"); + echo json_encode(array( + "err" => "ERR_PHP", + "msg" => "PHP " . MIN_PHP_VERSION . "+ required, only found " . PHP_VERSION, + "ver" => PHP_VERSION + )); + exit; +} function normalized_require_once($lib) { - require_once(preg_replace("#[\\\\/]+#", "/", dirname(__FILE__) . "/inc/${lib}.php")); + require_once(preg_replace("#[\\\\/]+#", "/", dirname(__FILE__) . "/${lib}.php")); } function __autoload($class_name) { - normalized_require_once("class-" . strtolower($class_name)); + normalized_require_once("inc/class-" . strtolower($class_name)); } +normalized_require_once("config"); Bootstrap::run();