From f6a03b2396588598e0347241b0feecdef3f0ac23 Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Tue, 6 Mar 2018 22:10:34 +0100 Subject: composer: use cache to fix slowness during startup Fixes #6647 Closes #6664 --- plugins/composer/composer.plugin.zsh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'plugins/composer/composer.plugin.zsh') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 2c6044aef..22ecbf299 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -49,7 +49,17 @@ alias cget='curl -s https://getcomposer.org/installer | php' # Add Composer's global binaries to PATH, using Composer if available. if (( $+commands[composer] )); then - export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) + _retrieve_cache composer + + if [[ -z $__composer_bin_dir ]]; then + __composer_bin_dir=$(composer global config bin-dir --absolute 2>/dev/null) + _store_cache composer __composer_bin_dir + fi + + # Add Composer's global binaries to PATH + export PATH="$PATH:$__composer_bin_dir" + + unset __composer_bin_dir else [ -d $HOME/.composer/vendor/bin ] && export PATH=$PATH:$HOME/.composer/vendor/bin [ -d $HOME/.config/composer/vendor/bin ] && export PATH=$PATH:$HOME/.config/composer/vendor/bin -- cgit v1.2.3-70-g09d2 From 2ecf2846cd7328c304364dd0c618036ea1675726 Mon Sep 17 00:00:00 2001 From: Gilles Date: Mon, 30 May 2016 10:03:40 +0200 Subject: composer: add aliases for 'outdated' commands Added `co` alias for `composer outdated` and `cod` for `composer outdated --direct` Closes #5127 --- plugins/composer/composer.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/composer/composer.plugin.zsh') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 22ecbf299..330360cdd 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -43,6 +43,8 @@ alias cdo='composer dump-autoload -o' alias cgu='composer global update' alias cgr='composer global require' alias cgrm='composer global remove' +alias co='composer outdated' +alias cod='composer outdated --direct' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' -- cgit v1.2.3-70-g09d2