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"
21 s/^\\s*global +\\\$$old *;//;
22 s/^(\\s*global) +\\\$$old *,/\\1 /;
23 s/^(\\s*global .*), *\\\$$old/\\1/;
24 s,\\\$GLOBALS\['$old'\](?"\!"\\s*=),$newstr,g;
25 s,\\\$GLOBALS\[$old\](?"\!"\\s*=),$newstr,g;
26 s,\\\$$old(?"\!"\\s*=),$newstr,g"