Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 40cf771

Browse files
author
Antonios Papadakis
committed
Add Sensible Defaults for PHP Installer
MacOS
1 parent 70cca36 commit 40cf771

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

macos/install.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
function compilePHP {
44
# Install All Dependencies
5-
read -pr 'Which PHP version would you like to install?[latest-7.1/latest-7.2/latest-7.3/latest-7.4/latest-8.0/latest-master] ' PHPINSTALLVERSION
5+
read -p 'Which PHP version would you like to install?[latest-7.1/latest-7.2/latest-7.3/default: latest-7.4/latest-8.0/latest-master] ' PHPINSTALLVERSION
6+
PHPINSTALLVERSION=${PHPINSTALLVERSION:-latest-7.4}
67

78
if [ "$PHPINSTALLVERSION" = latest-7.1 ]; then
89
cd ../releases/ || exit
@@ -21,7 +22,9 @@ function compilePHP {
2122
unzip php-src-php-7.4.10RC1.zip -d latest-7.4
2223
cd latest-7.4 || exit
2324
elif [ "$PHPINSTALLVERSION" = latest-8.0 ]; then
24-
read -pr 'This a BETA PHP version. This software has been tested, but bugs and errors are bound to appear in this early stage. This should not be used in a production environment. Are you sure you want to install?[y/Y/n/N] ' INSTALLCHOICE
25+
read -p 'This a BETA PHP version. This software has been tested, but bugs and errors are bound to appear in this early stage. This should not be used in a production environment. Are you sure you want to install?[y/Y/default: n/N] ' INSTALLCHOICE
26+
INSTALLCHOICE=${INSTALLCHOICE:-n}
27+
2528
if [ "$INSTALLCHOICE" = y ] || [ "$INSTALLCHOICE" = Y ]; then
2629
cd ../releases/ || exit
2730
unzip php-src-php-8.0.0beta2.zip -d latest-8.0
@@ -34,7 +37,8 @@ function compilePHP {
3437
exit 1
3538
fi
3639
elif [ "$PHPINSTALLVERSION" = latest-master ]; then
37-
read -pr 'CAREFUL: This is a pre-release version and is in heavy development. Install this only if you want the latest bleeding-edge features. These may not have been tested thoroughly and should not be used in a production environment. Are you sure you want to install?[y/Y/n/N] ' INSTALLCHOICE
40+
read -p 'CAREFUL: This is a pre-release version and is in heavy development. Install this only if you want the latest bleeding-edge features. These may not have been tested thoroughly and should not be used in a production environment. Are you sure you want to install?[y/Y/default: n/N] ' INSTALLCHOICE
41+
INSTALLCHOICE=${INSTALLCHOICE:-n}
3842
if [ "$INSTALLCHOICE" = y ] || [ "$INSTALLCHOICE" = Y ]; then
3943
git checkout php-src
4044
elif [ "$INSTALLCHOICE" = n ] || [ "$INSTALLCHOICE" = N ]; then
@@ -108,7 +112,8 @@ function compilePHP {
108112
fi
109113

110114
echo Tested PHP
111-
read -pr 'The tests have been completed and you may or may not have had failures on some of them. This can sometimes be ignored with the latest builds, or may need extra attention. Would you like to continue with installation?[y/Y/n/N] ' ERRORRESPONSE
115+
read -p 'The tests have been completed and you may or may not have had failures on some of them. This can sometimes be ignored with the latest builds, or may need extra attention. Would you like to continue with installation?[default: y/Y/n/N] ' ERRORRESPONSE
116+
ERRORRESPONSE=${ERRORRESPONSE:-y}
112117
if [ "$ERRORRESPONSE" = y ] || [ "$ERRORRESPONSE" = Y ]; then
113118
echo Installing PHP-CLI
114119
sudo make install || exit

0 commit comments

Comments
 (0)