dotfiles/bin/php_function_check.sh
2016-10-16 03:48:44 -05:00

19 lines
303 B
Bash
Executable file

#!/bin/bash
# check if a php function exists on a system
# output results to a file
usage() {
echo "Usage: $(basename $0) function_name > filename.php"
}
if [[ $1 = "--help" ]]; then
usage
exit 1
fi
if [[ $# != 1 ]]; then
usage
exit 1
fi
echo "<?php echo function_exists('"$1"')?'yes':'no'; ?>"