Skip to content

Commit 783d0ad

Browse files
committed
php-check command to quickly check php syntax
1 parent 89d2f3b commit 783d0ad

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

php-check

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
[[ "$1" = "recent" ]] && ADDITONAL_OPTIONS="-mmin -240"
4+
5+
find . $ADDITONAL_OPTIONS -name "*.php" -print0 | xargs -0 -n1 -P10 php -l | grep -v 'No syntax errors'
6+
7+
if [ "$?" -eq "0" ]; then
8+
exit 1
9+
else
10+
exit 0
11+
fi

0 commit comments

Comments
 (0)