diff options
author | Andrew Dolgov <[email protected]> | 2011-01-11 12:20:00 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-01-11 12:20:00 +0300 |
commit | 8fc26c419b6b5f948f57b7a4ee9e27962d43af5e (patch) | |
tree | fa7842f6707a293acefc4151b1d283215a30dacf /sanity_check.php | |
parent | 0efa586a10509c59d30835f23978bb29a8f1a6f5 (diff) |
properly check whether all constants are defined in config.php
Diffstat (limited to 'sanity_check.php')
-rw-r--r-- | sanity_check.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sanity_check.php b/sanity_check.php index 35d5c2a7f..d70445e02 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -11,6 +11,7 @@ } require_once "config.php"; + require_once "sanity_config.php"; if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) { $err_msg = "config: your config file version is incorrect. See config.php-dist.\n"; @@ -22,6 +23,16 @@ $err_msg = "config: HTMLPurifier cache directory should be writable by anyone (chmod -R 777 $purifier_cache_dir)"; } + if (GENERATED_CONFIG_CHECK != EXPECTED_CONFIG_VERSION) { + $err_msg = "config: your sanity_config.php is outdated, please recreate it using ./utils/regen_config_checks.sh"; + } + + foreach ($requred_defines as $d) { + if (!defined($d)) { + $err_msg = "config: required constant $d is not defined. Please check config.php"; + } + } + if (defined('RSS_BACKEND_TYPE')) { print "<b>Fatal error</b>: RSS_BACKEND_TYPE is deprecated. Please remove this option from config.php\n"; |