dotfiles/bin/php_function_check.sh

20 lines
303 B
Bash
Raw Permalink Normal View History

#!/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'; ?>"