Skip to content

Instantly share code, notes, and snippets.

@jqlblue
Last active December 19, 2015 10:19
Show Gist options
  • Save jqlblue/5939201 to your computer and use it in GitHub Desktop.
Save jqlblue/5939201 to your computer and use it in GitHub Desktop.
check php compatibility
#!/bin/sh
#use /usr/sh /path/script.sh > report.txt
SOURCE_ROOT='/source/code/directory'
PHP_BIN='/usr/bin/php5.5'
for file in $(find ${SOURCE_ROOT} -type f -iname '*.php'); do
check_syntax=$(${PHP_BIN} -d error_reporting=E_ALL -l $file | grep -v 'No syntax errors detected')
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment