forked from thoughtbot/laptop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
php
64 lines (52 loc) · 2.24 KB
/
php
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
echo "Installing phpenv ..."
git clone git://github.com/gotryiton/phpenv.git .phpenv
if [[ -f ~/.zshrc ]]; then
echo 'export PATH="$HOME/.phpenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(phpenv init -)"' >> ~/.zshrc
else
echo 'export PATH="$HOME/.phpenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(phpenv init -)"' >> ~/.bash_profile
fi
export PATH="$HOME/.phpenv/bin:$PATH"
eval "$(phpenv init -)"
cd $HOME
echo "Installing php-build dependencies ..."
brew install wget
brew install libmcrypt
brew install autoconf
brew install re2c
echo "Installing php-build ..."
git clone git://github.com/CHH/php-build.git
./php-build/install.sh
rmdir php-build
echo "Copying over updated php.ini with correct include_path ..."
$HOME/.phpenv/bin/phpenv install 5.4.5
$HOME/.phpenv/bin/phpenv rehash
mv $HOME/.phpenv/versions/5.4.5/etc/php.ini $HOME/.phpenv/versions/5.4.5/etc/php.ini.old
cp $HOME/laptop/config_files/php.ini $HOME/.phpenv/versions/5.4.5/etc/php.ini
echo "Installing Memcached module ..."
brew install libmemcached
$HOME/.phpenv/shims/pyrus install pecl/memcached
$HOME/.phpenv/shims/pyrus build pecl/memcached
echo "extension=memcached.so" >> $HOME/.phpenv/versions/5.4.5/etc/conf.d/extensions.ini
echo "Installing phpunit ..."
$HOME/.phpenv/shims/pyrus channel-discover pear.phpunit.de
$HOME/.phpenv/shims/pyrus channel-discover components.ez.no
$HOME/.phpenv/shims/pyrus channel-discover pear.symfony-project.com
$HOME/.phpenv/shims/pyrus install -o phpunit/PHPUnit
echo "Installing phpsh ..."
sudo easy_install readline
git clone git://github.com/gotryiton/phpsh.git $HOME/laptop/phpsh
cd $HOME/laptop/phpsh
python setup.py install --prefix=~
cp $HOME/laptop/phpsh/build/scripts-2.7/phpsh $HOME/bin/phpsh
if [[ -f ~/.zshrc ]]; then
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
echo 'export PYTHONPATH=~/lib/python2.7/site-packages' >> ~/.zshrc
else
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bash_profile
echo 'export PYTHONPATH=~/lib/python2.7/site-packages' >> ~/.bash_profile
fi
sed s/MY_USER_NAME/$USER/ $HOME/laptop/config_files/phpsh_temp.rc > $HOME/laptop/config_files/phpsh.rc
cp $HOME/laptop/config_files/phpsh.rc $HOME/.phpsh/phpsh.rc