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

Commit 977ae4d

Browse files
author
Antonios Papadakis
committed
Merge branch 'v0.4'
2 parents 4922ded + 91b83de commit 977ae4d

File tree

1 file changed

+102
-11
lines changed

1 file changed

+102
-11
lines changed

macos/install.sh

Lines changed: 102 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,118 @@ function setup {
99
# Setup Correct files depending on PHP installation version choice
1010
if [ "$PHPINSTALLVERSION" = latest-7.1 ]; then
1111
cd ../releases/ || exit
12-
unzip php-src-php-7.1.32.zip -d latest-7.1
13-
cd latest-7.1 || exit
12+
ls latest-7.1
13+
ISFOLDERPRESENT=$?
14+
if [ "$ISFOLDERPRESENT" = 1 ]; then
15+
unzip php-src-php-7.1.32.zip -d latest-7.1
16+
cd latest-7.1 || exit
17+
elif [ "$ISFOLDERPRESENT" = 0 ]; then
18+
read -p 'There already is a folder with this version of PHP. Would you like to remove it?[default: n/N/y/Y] ' FOLDERCHOICE
19+
FOLDERCHOICE=${FOLDERCHOICE:-n}
20+
if [ "$FOLDERCHOICE" = y ] || [ "$FOLDERCHOICE" = Y ]; then
21+
sudo rm -r latest-7.1
22+
unzip php-src-php-7.1.32.zip -d latest-7.1
23+
cd latest-7.1 || exit
24+
elif [ "$FOLDERCHOICE" = n ] || [ "$FOLDERCHOICE" = N ]; then
25+
echo cancelling installation
26+
setup
27+
else
28+
echo invalid argument, exiting...
29+
setup
30+
fi
31+
fi
32+
1433
elif [ "$PHPINSTALLVERSION" = latest-7.2 ]; then
1534
cd ../releases/ || exit
16-
unzip php-src-php-7.2.33.zip -d latest-7.2
17-
cd latest-7.2 || exit
35+
ls latest-7.2
36+
ISFOLDERPRESENT=$?
37+
if [ "$ISFOLDERPRESENT" = 1 ]; then
38+
unzip php-src-php-7.2.33.zip -d latest-7.2
39+
cd latest-7.2 || exit
40+
elif [ "$ISFOLDERPRESENT" = 0 ]; then
41+
read -p 'There already is a folder with this version of PHP. Would you like to remove it?[default: n/N/y/Y] ' FOLDERCHOICE
42+
FOLDERCHOICE=${FOLDERCHOICE:-n}
43+
if [ "$FOLDERCHOICE" = y ] || [ "$FOLDERCHOICE" = Y ]; then
44+
sudo rm -r latest-7.2
45+
unzip php-src-php-7.2.33.zip -d latest-7.2
46+
cd latest-7.2 || exit
47+
elif [ "$FOLDERCHOICE" = n ] || [ "$FOLDERCHOICE" = N ]; then
48+
echo cancelling installation
49+
setup
50+
else
51+
echo invalid argument, exiting...
52+
setup
53+
fi
54+
fi
1855
elif [ "$PHPINSTALLVERSION" = latest-7.3 ]; then
1956
cd ../releases/ || exit
20-
unzip php-src-php-7.3.22RC1.zip -d latest-7.3
21-
cd latest-7.3 || exit
57+
ls latest-7.3
58+
ISFOLDERPRESENT=$?
59+
if [ "$ISFOLDERPRESENT" = 1 ]; then
60+
unzip php-src-php-7.3.22RC1.zip -d latest-7.3
61+
cd latest-7.3 || exit
62+
elif [ "$ISFOLDERPRESENT" = 0 ]; then
63+
read -p 'There already is a folder with this version of PHP. Would you like to remove it?[default: n/N/y/Y] ' FOLDERCHOICE
64+
FOLDERCHOICE=${FOLDERCHOICE:-n}
65+
if [ "$FOLDERCHOICE" = y ] || [ "$FOLDERCHOICE" = Y ]; then
66+
sudo rm -r latest-7.3
67+
unzip php-src-php-7.3.22RC1.zip -d latest-7.3
68+
cd latest-7.3 || exit
69+
elif [ "$FOLDERCHOICE" = n ] || [ "$FOLDERCHOICE" = N ]; then
70+
echo cancelling installation
71+
setup
72+
else
73+
echo invalid argument, exiting...
74+
setup
75+
fi
76+
fi
2277
elif [ "$PHPINSTALLVERSION" = latest-7.4 ]; then
2378
cd ../releases/ || exit
24-
unzip php-src-php-7.4.10RC1.zip -d latest-7.4
25-
cd latest-7.4 || exit
79+
ls latest-7.4
80+
ISFOLDERPRESENT=$?
81+
if [ "$ISFOLDERPRESENT" = 1 ]; then
82+
unzip php-src-php-7.4.10RC1.zip -d latest-7.4
83+
cd latest-7.4 || exit
84+
elif [ "$ISFOLDERPRESENT" = 0 ]; then
85+
read -p 'There already is a folder with this version of PHP. Would you like to remove it?[default: n/N/y/Y] ' FOLDERCHOICE
86+
FOLDERCHOICE=${FOLDERCHOICE:-n}
87+
if [ "$FOLDERCHOICE" = y ] || [ "$FOLDERCHOICE" = Y ]; then
88+
sudo rm -r latest-7.4
89+
unzip php-src-php-7.4.10RC1.zip -d latest-7.4
90+
cd latest-7.4 || exit
91+
elif [ "$FOLDERCHOICE" = n ] || [ "$FOLDERCHOICE" = N ]; then
92+
echo cancelling installation
93+
setup
94+
else
95+
echo invalid argument, exiting...
96+
setup
97+
fi
98+
fi
2699
elif [ "$PHPINSTALLVERSION" = latest-8.0 ]; then
27-
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
100+
read -p 'This a BETA PHP version and. 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
28101
INSTALLCHOICE=${INSTALLCHOICE:-n}
29102

30103
if [ "$INSTALLCHOICE" = y ] || [ "$INSTALLCHOICE" = Y ]; then
31104
cd ../releases/ || exit
32-
unzip php-src-php-8.0.0beta2.zip -d latest-8.0
33-
cd latest-8.0 || exit
105+
ls latest-8.0
106+
ISFOLDERPRESENT=$?
107+
if [ "$ISFOLDERPRESENT" = 1 ]; then
108+
unzip php-src-php-8.0.0beta2.zip -d latest-8.0
109+
cd latest-8.0 || exit
110+
elif [ "$ISFOLDERPRESENT" = 0 ]; then
111+
read -p 'There already is a folder with this version of PHP. Would you like to remove it?[default: n/N/y/Y] ' FOLDERCHOICE
112+
FOLDERCHOICE=${FOLDERCHOICE:-n}
113+
if [ "$FOLDERCHOICE" = y ] || [ "$FOLDERCHOICE" = Y ]; then
114+
sudo rm -r latest-8.0
115+
unzip php-src-php-8.0.0beta2.zip -d latest-8.0
116+
cd latest-8.0 || exit
117+
elif [ "$FOLDERCHOICE" = n ] || [ "$FOLDERCHOICE" = N ]; then
118+
echo cancelling installation
119+
setup
120+
else
121+
echo invalid argument, exiting...
122+
setup
123+
fi
34124
elif [ "$INSTALLCHOICE" = n ] || [ "$INSTALLCHOICE" = N ]; then
35125
echo cancelling installation
36126
setup
@@ -56,6 +146,7 @@ function setup {
56146
echo cancelling installation
57147
exit 130
58148
fi
149+
fi
59150

60151
# Install dependencies using Homebrew
61152
echo Installing Dependencies

0 commit comments

Comments
 (0)