From 90d8fc7e869852bb5a6beadc63c52ea9cdb51adf Mon Sep 17 00:00:00 2001
From: Oleg Pudeyev <oleg@bsdpower.com>
Date: Wed, 18 Aug 2010 22:52:26 -0400
Subject: [ticket/9777] Print error message in pre-commit hook when php is not
 installed.

PHPBB3-9777
---
 git-tools/hooks/pre-commit | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'git-tools')

diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 9719b91746..4d03359773 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -27,6 +27,13 @@ fi
 error=0
 errors=""
 
+if ! which $PHP_BIN >/dev/null 2>&1
+then
+	echo "PHP Syntax check failed:"
+	echo "PHP binary does not exist or is not in path: $PHP_BIN"
+	exit 1
+fi
+
 # dash does not support $'\n':
 # http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html
 IFS='
-- 
cgit v1.2.1