3 # Usage: unify_config.sh <old variable> <new variable> [ <section> ]
4 # Example: unify_config.sh sys_default_domain web_host
10 if [ "$sect" = "" ] ; then
11 newstr="forge_get_config('$new')"
13 newstr="forge_get_config('$new', '$sect')"
17 ack-grep -l --php $old | grep -v www/include/pre.php
20 find_files | xargs perl -pi -e"s/(\\s*global .*)\\\$$old, */\\1/"
21 find_files | xargs perl -pi -e"s/(\\s*global .*)\\\$$old *;//"
22 find_files | xargs perl -pi -e"s,\\\$GLOBALS\['$old'\](?"\!"\\s*=),$newstr,g"
23 find_files | xargs perl -pi -e"s,\\\$GLOBALS\[$old\](?"\!"\\s*=),$newstr,g"
24 find_files | xargs perl -pi -e"s,\\\$$old(?"\!"\\s*=),$newstr,g"