]> git.mxchange.org Git - friendica.git/commitdiff
added lint.sh which needs to be executed like this:
authorRoland Häder <roland@mxchange.org>
Wed, 14 Dec 2016 11:45:11 +0000 (12:45 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 14 Dec 2016 11:45:11 +0000 (12:45 +0100)
$ ./util/lint.sh

No parameters needed. It will use "php -l" (current interpreter) for checking
for syntax errors in all PHP scripts.

Signed-off-by: Roland Häder <roland@mxchange.org>
util/lint.sh [new file with mode: 0755]

diff --git a/util/lint.sh b/util/lint.sh
new file mode 100755 (executable)
index 0000000..ef1530f
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if ! test -e "index.php"; then
+       echo "$0: Please execute this script from root directory."
+       exit 1
+fi
+
+echo "$0: Analysing PHP scripts for syntax errors (lint) ..."
+LINT=`find -type f -name "*.php" -exec php -l -f {} 2>&1 \; | grep -v "No syntax errors detected in" | grep -v "FUSE_EDEADLK" | sort --unique`
+
+if test "${LINT}" != ""; then
+       echo "${LINT}"
+else
+       echo "$0: No syntax errors found."
+fi