X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Fsanity_check.php;h=8a38ec5238a552aeb282db334248213be3a69ef1;hb=81fc862e370a1dfbd3941206fd00076e3cbf0551;hp=a84959f8e846600eff23fdd0f40a86103c705bdd;hpb=c463a95dca0a5f2fbcdc1b67fd97f8c1159523f5;p=tt-rss.git diff --git a/include/sanity_check.php b/include/sanity_check.php index a84959f8..8a38ec52 100755 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -46,8 +46,8 @@ array_push($errors, "Please don't run this script as root."); } - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - array_push($errors, "PHP version 5.4.0 or newer required."); + if (version_compare(PHP_VERSION, '5.6.0', '<')) { + array_push($errors, "PHP version 5.6.0 or newer required. You're using " . PHP_VERSION . "."); } if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) { @@ -70,30 +70,24 @@ array_push($errors, "Javascript cache is not writable (chmod -R 777 ".CACHE_DIR."/js)"); } - if (strlen(FEED_CRYPT_KEY) > 0 && strlen(FEED_CRYPT_KEY) != 24) { - array_push($errors, "FEED_CRYPT_KEY should be exactly 24 characters in length."); - } - - if (strlen(FEED_CRYPT_KEY) > 0 && !function_exists("mcrypt_decrypt")) { - array_push($errors, "FEED_CRYPT_KEY requires mcrypt functions which are not found."); - } - if (GENERATED_CONFIG_CHECK != EXPECTED_CONFIG_VERSION) { array_push($errors, "Configuration option checker sanity_config.php is outdated, please recreate it using ./utils/regen_config_checks.sh"); } - foreach ($requred_defines as $d) { + foreach ($required_defines as $d) { if (!defined($d)) { array_push($errors, "Required configuration file parameter $d is not defined in config.php. You might need to copy it from config.php-dist."); } } - if (SINGLE_USER_MODE) { - $result = db_query("SELECT id FROM ttrss_users WHERE id = 1"); + if (SINGLE_USER_MODE && class_exists("PDO")) { + $pdo = DB::pdo(); - if (db_num_rows($result) != 1) { + $res = $pdo->query("SELECT id FROM ttrss_users WHERE id = 1"); + + if (!$res->fetch()) { array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found."); } } @@ -137,6 +131,10 @@ array_push($errors, "PHP support for PostgreSQL is required for configured DB_TYPE in config.php"); } + if (!class_exists("PDO")) { + array_push($errors, "PHP support for PDO is required but was not found."); + } + if (!function_exists("mb_strlen")) { array_push($errors, "PHP support for mbstring functions is required but was not found."); } @@ -186,9 +184,9 @@ Startup failed - + - +