From: Ben Sherratt Date: Wed, 26 Jul 2023 12:06:40 +0000 (+0900) Subject: Added PHP version check X-Git-Url: https://git.bts.cx/cx.git/commitdiff_plain/ebc8e87c4a08bc35375a75642a068411c54a5fa3?ds=inline;hp=27850f5b260560bdf75f3fca169ec5950ed00b22 Added PHP version check Also changed quotes --- diff --git a/public/index.php b/public/index.php index 79e00a4..61216a8 100644 --- a/public/index.php +++ b/public/index.php @@ -9,9 +9,16 @@ `---' */ -$main_file = join(DIRECTORY_SEPARATOR, array(__DIR__, "..", "cx", "cx.php")); -$db_file = join(DIRECTORY_SEPARATOR, array(__DIR__, "..", "db", "btscx.db")); -$data_folder = join(DIRECTORY_SEPARATOR, array(__DIR__, "..", "data")); -$public_data_folder = join(DIRECTORY_SEPARATOR, array(__DIR__, "data")); +define('CX_PHP_VERSION', '8.0.0'); + +if (version_compare(phpversion(), CX_PHP_VERSION) < 0) { + echo('Requires PHP version ' . CX_PHP_VERSION . ' or later'); + exit; +} + +$main_file = join(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'cx', 'cx.php')); +$db_file = join(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'db', 'btscx.db')); +$data_folder = join(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'data')); +$public_data_folder = join(DIRECTORY_SEPARATOR, array(__DIR__, 'data')); require_once($main_file); cx($db_file, $data_folder, $public_data_folder);