Created
January 9, 2016 10:52
-
-
Save gerardroche/a91b2fb4983fd78c53f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
unset CDPATH | |
unset IFS | |
init_strip_require_once() { | |
current_dir_name="$(basename "$PWD")" | |
if [ "$current_dir_name" = "Zend" -o "$current_dir_name" = "ZendX" ]; then | |
find . -name '*.php' \ | |
-not -wholename '*/Loader/Autoloader.php' \ | |
-not -wholename '*/Loader/StandardAutoloader.php' \ | |
-not -wholename '*/Application.php' \ | |
-print0 | xargs -0 \ | |
sed --regexp-extended \ | |
--in-place 's/(require_once)/\/\/ COMMENTED_REQUIRE_ONCE \1/g' | |
else | |
echo >&2 "$0: zend framework directory not found" | |
exit 1 | |
fi | |
} | |
case "$1" in | |
--stip-require-once) | |
init_strip_require_once | |
exit 0 | |
;; | |
esac | |
echo "usage: $0 --stip-require-once" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment