forked from classyllama/Wiz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wiz
executable file
·29 lines (24 loc) · 878 Bytes
/
wiz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
WIZ_SCRIPT_PATH=`dirname $_`
WIZ_REQUIRED_PHP_VERSION="5.2"
WIZ_FOUND_PHP=0
if [ "" == "$WIZ_PHP_PATH" ]; then
IFS=:
for p in $PATH; do
if [ -x "$p/php" ]; then
WIZ_FOUND_PHP=1
VALID_VERSION=`$p/php -r "echo (int) version_compare(PHP_VERSION, '$WIZ_REQUIRED_PHP_VERSION', '>=');"`
if [ "1" == "$VALID_VERSION" ]; then
WIZ_PHP_PATH="$p/php";
fi
fi;
done
fi
if [ "1" == "$WIZ_FOUND_PHP" -a -z "$WIZ_PHP_PATH" ]; then
echo "Found a PHP executable, but it's not a version >= $WIZ_REQUIRED_PHP_VERSION. You can specify one by setting WIZ_PHP_PATH.";
exit;
elif [ -z "$WIZ_PHP_PATH" ]; then
echo "Unable to find a PHP >= $WIZ_REQUIRED_PHP_VERSION executable. You can specify one by setting WIZ_PHP_PATH.";
exit;
fi
$WIZ_PHP_PATH $WIZ_SCRIPT_PATH/wiz.php $@