Add dev/php

This commit is contained in:
Henrik Lissner 2018-01-28 20:56:47 -05:00
parent f3a93081e9
commit 66c441fb2e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 33 additions and 0 deletions

27
dev/php/_init Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env zsh
source ${0:A:h}/../../deploy
source env.zsh
install() {
_ensure_repo madumlao/phpenv $PHPENV_ROOT
_ensure_repo php-build/php-build $PHPENV_ROOT/plugins/php-build
case $(_os) in
arch) pacaur --needed --noconfirm --noedit -S libmcrypt tidy ;;
macos) brew install libmcrypt tidy-html5 ;;
esac
}
update() {
if [[ -n $PHPENV_ROOT ]]; then
cd $PHPENV_ROOT && git pull
for ver in $PHPENV_ROOT/plugins/*(/N); do
cd $ver && git pull
done
fi
}
# link() { }
# clean() { }
init "$@"

3
dev/php/aliases.zsh Normal file
View file

@ -0,0 +1,3 @@
alias phe='phpenv'
alias phr='php-boris'
alias comp='composer'

3
dev/php/env.zsh Normal file
View file

@ -0,0 +1,3 @@
export PHPENV_ROOT="$XDG_DATA_HOME/phpenv"
path=( $PHPENV_ROOT/bin $PHPENV_ROOT/shims $path )
_cache phpenv init - --no-rehash