summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-01-11 12:20:00 +0300
committerAndrew Dolgov <[email protected]>2011-01-11 12:20:00 +0300
commit8fc26c419b6b5f948f57b7a4ee9e27962d43af5e (patch)
treefa7842f6707a293acefc4151b1d283215a30dacf /utils
parent0efa586a10509c59d30835f23978bb29a8f1a6f5 (diff)
properly check whether all constants are defined in config.php
Diffstat (limited to 'utils')
-rwxr-xr-xutils/regen_config_checks.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/regen_config_checks.sh b/utils/regen_config_checks.sh
new file mode 100755
index 000000000..78f2dbfba
--- /dev/null
+++ b/utils/regen_config_checks.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+DESTINATION="sanity_config.php"
+
+echo "<?php # This file has been generated at: " `date` > $DESTINATION
+
+echo -n "define('GENERATED_CONFIG_CHECK', " >> $DESTINATION
+grep CONFIG_VERSION config.php-dist | awk -F ' |)' '{ print $2 }' | xargs echo -n >> $DESTINATION
+echo ");" >> $DESTINATION
+
+echo -n "\$requred_defines = array( " >> $DESTINATION
+
+grep define\( config.php-dist | awk -F\' '{ print "*" $2 "*," }' | xargs echo -n | sed -e s/,$// -e s/*/\'/g >> $DESTINATION
+
+echo "); ?>" >> $DESTINATION
+
+