diff --git a/dev/php/_init b/dev/php/_init new file mode 100755 index 00000000..a1bba52f --- /dev/null +++ b/dev/php/_init @@ -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 "$@" diff --git a/dev/php/aliases.zsh b/dev/php/aliases.zsh new file mode 100644 index 00000000..c438fd8a --- /dev/null +++ b/dev/php/aliases.zsh @@ -0,0 +1,3 @@ +alias phe='phpenv' +alias phr='php-boris' +alias comp='composer' diff --git a/dev/php/env.zsh b/dev/php/env.zsh new file mode 100644 index 00000000..07322eb4 --- /dev/null +++ b/dev/php/env.zsh @@ -0,0 +1,3 @@ +export PHPENV_ROOT="$XDG_DATA_HOME/phpenv" +path=( $PHPENV_ROOT/bin $PHPENV_ROOT/shims $path ) +_cache phpenv init - --no-rehash