From 0a24db5e7c8c3afcb536b79d40addc1fe4ef5fbd Mon Sep 17 00:00:00 2001 From: Justin Otherguy Date: Wed, 25 May 2011 21:34:11 +0200 Subject: [PATCH] added version check for php 5.3+ --- misc/tools/install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc/tools/install.sh b/misc/tools/install.sh index 3ba6863..6e74755 100755 --- a/misc/tools/install.sh +++ b/misc/tools/install.sh @@ -37,6 +37,8 @@ shopt -s nocasematch doctrine_git=git://github.com/doctrine/doctrine2.git doctrine_tar=http://www.doctrine-project.org/downloads/DoctrineORM-2.0.1-full.tar.gz vz_git=git://github.com/volkszaehler/volkszaehler.org.git +PHP_MAJOR=`/usr/bin/php --version | /bin/grep "^PHP" | /usr/bin/awk ' { print $2 } ' | /usr/bin/cut -b 1 ` +PHP_MINOR=`/usr/bin/php --version | /bin/grep "^PHP" | /usr/bin/awk ' { print $2 } ' | /usr/bin/cut -b 3 ` ask() { question=$1 @@ -61,6 +63,19 @@ get_db_name() { db_name=$REPLY } +############ +# check prerequisites +if [ ${PHP_MAJOR }-lt "5" ] ; then + echo you need PHP version 5.3+ to run volkszaehler + exit +elif [ ${PHP_MAJOR} == "5" ] + if [ ${PHP_MINOR }-lt "3" ] ; then + echo you need PHP version 5.3+ to run volkszaehler + exit + fi +fi + + ############ echo echo doctrine setup...