X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=contrib%2Ffind-bad-php.sh;h=6febfcfc0d009f5c817dafe93bc27379372c6db4;hp=85af1b24555a99968d6d8dee410429de5626508f;hb=2882b57ca6f372b822f96034ff2fe6aafd7daeb8;hpb=2184e4124fec09c2ac74b8092a4a67389d6ac958 diff --git a/contrib/find-bad-php.sh b/contrib/find-bad-php.sh index 85af1b24..6febfcfc 100755 --- a/contrib/find-bad-php.sh +++ b/contrib/find-bad-php.sh @@ -1,13 +1,13 @@ #!/bin/sh echo "$0: Searching for PHP scripts (except 3rd party) ..." -PHP=`find -type f -name "*.php" 2>&1 | grep -v "third_party"` +PHP=$(find -type f -name "*.php" 2>&1 | grep -v "third_party" | grep -v "/vendor/" | grep -v "smarty3/compiled/") for SCRIPT in ${PHP}; do - HEADER=`cat ${SCRIPT} | head -n 1 | grep -v ""` + FOOTER=$(cat ${SCRIPT} | tail -n 1 | grep "?>") if [ -n "${HEADER}" ]; then @@ -16,10 +16,10 @@ do if [ -n "${FOOTER}" ]; then - echo "$0: Script '${SCRIPT}' has non-typical footer." + echo "$0: Script '${SCRIPT}' has discouraged footer." fi - LINT=`php -l "${SCRIPT}" 2>&1 | grep -v "Constant FUSE_EDEADLK already defined in Unknown on line 0" | grep -v "No syntax errors detected in"` + LINT=$(php -l "${SCRIPT}" 2>&1 | grep -v "Constant FUSE_EDEADLK already defined in Unknown on line 0" | grep -v "No syntax errors detected in") if [ -n "${LINT}" ] then