forked from playsms/playsms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetcomposer.sh
executable file
·39 lines (32 loc) · 976 Bytes
/
getcomposer.sh
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
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
PATHSRC=$(pwd)
echo
echo "Getting composer from https://getcomposer.com"
echo
echo "Please wait while this script downloading composer"
echo
php -r "readfile('https://getcomposer.org/installer');" | php >/dev/null 2>&1
if [ -e "composer.phar" ]; then
#rm -f /usr/local/bin/composer /usr/local/bin/composer.phar >/dev/null 2>&1
rm -f ./composer >/dev/null 2>&1
ln -s ./composer.phar ./composer >/dev/null 2>&1
#mv composer composer.phar /usr/local/bin/ >/dev/null 2>&1
#chmod +x /usr/local/bin/composer /usr/local/bin/composer.phar >/dev/null 2>&1
chmod +x ./composer.phar >/dev/null 2>&1
fi
echo "Composer has been installed"
echo
echo "Please wait while composer getting and updating required packages"
echo
if [ -x "./composer.phar" ]; then
cd "$PATHSRC"
./composer.phar update
else
echo "ERROR: unable to get composer from https://getcomposer.com"
echo
exit 1
fi
echo
echo "Composer has been installed and packages has been updated"
echo
exit 0