December 17, 2020

find-and-replace-cakephp-upgrade

grep -inFR "::config()" src config
grep -inFR "::config(" src config
echo "::config(" > /tmp/pattern
echo "::setConfig(" > /tmp/replacement
find src config \( -name "*.php" -o -name "*.ctp" \) | xargs -n 1 sed -i -e "s|$(cat /tmp/pattern)|$(cat /tmp/replacement)|g"

No comments: