Skip to content

Commit 8eb1e47

Browse files
committed
PHP 7
1 parent 2306e6a commit 8eb1e47

File tree

2 files changed

+71
-77
lines changed

2 files changed

+71
-77
lines changed

README.md

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
1-
# dhcomposer
2-
3-
shell script to automate Composer install on shared DreamHost account
4-
5-
## installation
6-
7-
1. ssh into your account and clone dhcomposer repository:
8-
9-
````
10-
git clone https://github.com/kminek/dhcomposer
11-
````
12-
13-
2. run the script:
14-
15-
````
16-
cd dhcomposer
17-
chmod u+x dhcomposer.sh
18-
source dhcomposer.sh
19-
````
20-
21-
3. verify Composer install:
22-
23-
````
24-
composer --version
25-
````
26-
27-
4. enjoy
28-
29-
## credits
30-
31-
- [Installing Composer on Dreamhost | Geekality](http://www.geekality.net/2013/02/01/dreamhost-composer/)
32-
- [Installing Composer on a shared Dreamhost Server](https://github.com/Braunson/dreamhost-composer-install)
1+
# dhcomposer
2+
3+
shell script to automate Composer install on shared DreamHost account
4+
5+
## installation
6+
7+
1. ssh into your account and run:
8+
9+
````
10+
cd && git clone https://github.com/kminek/dhcomposer && cd dhcomposer && chmod u+x dhcomposer.sh && source dhcomposer.sh
11+
````
12+
13+
2. verify Composer install:
14+
15+
````
16+
composer --version
17+
````
18+
19+
3. enjoy
20+
21+
## credits
22+
23+
- [Installing Composer on Dreamhost | Geekality](http://www.geekality.net/2013/02/01/dreamhost-composer/)
24+
- [Installing Composer on a shared Dreamhost Server](https://github.com/Braunson/dreamhost-composer-install)

dhcomposer.sh

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,75 +11,77 @@ clear
1111

1212
selection=
1313
until [ "$selection" = "0" ]; do
14-
echo ""
15-
echo "This shell script will install Composer on your shared DreamHost account"
16-
echo "Pick PHP version to use:"
17-
echo ""
18-
echo "1 - PHP 5.3"
19-
echo "2 - PHP 5.4"
20-
echo "3 - PHP 5.5"
21-
echo "4 - PHP 5.6"
22-
echo ""
23-
echo "0 - do nothing, exit"
24-
echo ""
25-
echo -n "Enter selection: "
26-
read selection
27-
echo ""
28-
case $selection in
29-
1 ) VER="5.3"; break ;;
30-
2 ) VER="5.4"; break ;;
31-
3 ) VER="5.5"; break ;;
32-
4 ) VER="5.6"; break ;;
33-
0 ) return ;;
34-
* ) echo "Please enter 1, 2, 3, 4 or 0"
35-
esac
14+
echo ""
15+
echo "This shell script will install Composer on your shared DreamHost account"
16+
echo "Pick PHP version to use:"
17+
echo ""
18+
echo "1 - PHP 5.3"
19+
echo "2 - PHP 5.4"
20+
echo "3 - PHP 5.5"
21+
echo "4 - PHP 5.6"
22+
echo "5 - PHP 7.0"
23+
echo ""
24+
echo "0 - do nothing, exit"
25+
echo ""
26+
echo -n "Enter selection: "
27+
read selection
28+
echo ""
29+
case $selection in
30+
1 ) VER="5.3"; break ;;
31+
2 ) VER="5.4"; break ;;
32+
3 ) VER="5.5"; break ;;
33+
4 ) VER="5.6"; break ;;
34+
5 ) VER="7.0"; break ;;
35+
0 ) return ;;
36+
* ) echo "Please enter 1, 2, 3, 4, 5 or 0"
37+
esac
3638
done
3739

3840
if [ ! -d ~/bin ]; then
39-
echo "Creating ~/bin directory ..."
40-
mkdir ~/bin
41+
echo "Creating ~/bin directory ..."
42+
mkdir ~/bin
4143
fi
4244

4345
if [ -f ~/bin/php ]; then
44-
rm ~/bin/php
46+
rm ~/bin/php
4547
fi
4648

4749
echo "Creating symlink to php binary inside ~/bin directory ..."
4850
ln -s /usr/local/bin/php-$VER ~/bin/php
4951

5052
if [[ ! ":$PATH:" == *":$HOME/bin:"* ]]; then
51-
echo "Adding ~/bin to PATH"
52-
echo "export PATH=~/bin:\$PATH" >> ~/.bash_profile
53-
echo "export PATH=~/bin:\$PATH" >> ~/.bashrc
54-
. ~/.bash_profile
55-
. ~/.bashrc
53+
echo "Adding ~/bin to PATH"
54+
echo "export PATH=~/bin:\$PATH" >> ~/.bash_profile
55+
echo "export PATH=~/bin:\$PATH" >> ~/.bashrc
56+
. ~/.bash_profile
57+
. ~/.bashrc
5658
fi
5759

5860
PHAR=$(php -m | grep Phar)
5961

6062
if [ ! "$PHAR" == "Phar" ]; then
6163

62-
if [ ! -d ~/.php/$VER ]; then
63-
echo "Creating ~/.php/$VER directory ..."
64-
mkdir -p ~/.php/$VER
65-
fi
64+
if [ ! -d ~/.php/$VER ]; then
65+
echo "Creating ~/.php/$VER directory ..."
66+
mkdir -p ~/.php/$VER
67+
fi
6668

67-
if [ ! -f ~/.php/$VER/phprc ]; then
68-
echo "Creating ~/.php/$VER/phprc file ..."
69-
touch ~/.php/$VER/phprc
70-
fi
69+
if [ ! -f ~/.php/$VER/phprc ]; then
70+
echo "Creating ~/.php/$VER/phprc file ..."
71+
touch ~/.php/$VER/phprc
72+
fi
7173

72-
echo "Adding phar extension in ~/.php/$VER/phprc file ..."
73-
echo "extension = phar.so" >> ~/.php/$VER/phprc
74-
echo "suhosin.executor.include.whitelist = phar" >> ~/.php/$VER/phprc
74+
echo "Adding phar extension in ~/.php/$VER/phprc file ..."
75+
echo "extension = phar.so" >> ~/.php/$VER/phprc
76+
echo "suhosin.executor.include.whitelist = phar" >> ~/.php/$VER/phprc
7577

7678
fi
7779

7880
if [ ! -f ~/bin/composer ]; then
79-
echo "Installing Composer ..."
80-
curl -sS https://getcomposer.org/installer | php -- --install-dir=$HOME/bin
81-
mv ~/bin/composer.phar ~/bin/composer
82-
chmod u+x ~/bin/composer
81+
echo "Installing Composer ..."
82+
curl -sS https://getcomposer.org/installer | php -- --install-dir=$HOME/bin
83+
mv ~/bin/composer.phar ~/bin/composer
84+
chmod u+x ~/bin/composer
8385
fi
8486

8587
echo "Done."

0 commit comments

Comments
 (0)