From 98d8d3429f8b9fc2c4c109fb199a31c8d1735699 Mon Sep 17 00:00:00 2001 From: travoltron Date: Mon, 20 Feb 2017 13:21:36 -0500 Subject: Update composer.plugin.zsh (#5889) Adds remove/global remove and optimize-autoloader commands. --- plugins/composer/composer.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/composer') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 07eb1de88..ac272060b 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -39,11 +39,14 @@ alias c='composer' alias csu='composer self-update' alias cu='composer update' alias cr='composer require' +alias crm='composer remove' alias ci='composer install' alias ccp='composer create-project' alias cdu='composer dump-autoload' +alias cdo='composer dump-autoload --optimize-autoloader' alias cgu='composer global update' alias cgr='composer global require' +alias cgrm='composer global remove' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' -- cgit v1.2.3-70-g09d2 From 4fba92e04fa9b62b2259abc45eb92ca6a74f1639 Mon Sep 17 00:00:00 2001 From: Ricardo Pérez Date: Thu, 23 Feb 2017 08:52:23 +0100 Subject: Use proper config bin directory (#5886) Add the proper config bin directory to `PATH` instead of the previously (incorrect) fixed `~/.composer/vendor/bin`. Nowadays the right config dir is `~/.config/composer/vendor/bin`. --- plugins/composer/composer.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/composer') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index ac272060b..8cf50d502 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -52,4 +52,4 @@ alias cgrm='composer global remove' alias cget='curl -s https://getcomposer.org/installer | php' # Add Composer's global binaries to PATH -export PATH=$PATH:~/.composer/vendor/bin +export PATH=$PATH:$(composer global config bin-dir --absolute) 2>/dev/null -- cgit v1.2.3-70-g09d2 From 1fca822ab229ed2bd0dbc8c7b2ea9fbcd7e1d2fc Mon Sep 17 00:00:00 2001 From: jrisebor Date: Tue, 7 Nov 2017 10:50:08 -0500 Subject: Fix Standard Error Redirection for composer plugin (#5935) --- plugins/composer/composer.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/composer') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 8cf50d502..d00813e39 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -52,4 +52,4 @@ alias cgrm='composer global remove' alias cget='curl -s https://getcomposer.org/installer | php' # Add Composer's global binaries to PATH -export PATH=$PATH:$(composer global config bin-dir --absolute) 2>/dev/null +export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) -- cgit v1.2.3-70-g09d2 From 0de3b29fd3fde0d5d95271cb076a12931ccee7d8 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sun, 19 Aug 2018 15:46:22 -0400 Subject: composer: Fix bin directory when Composer is not available (#6240) * Fix for Composer's bin when Composer isn't global When Composer isn't globally installed, the `composer global` call results in an error. This checks to see if Composer is available before making the call. When Composer isn't available, it will just manually set the directories. * Fix Composer brackets in global bin directory * composer: Apply feedback from ricpelo This applies ricpelo's feedback at https://github.com/robbyrussell/oh-my-zsh/pull/6240#pullrequestreview-64253321 * composer: Fix path check syntax * composer: test with $commands[] syntax --- plugins/composer/composer.plugin.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins/composer') diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index d00813e39..634961023 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -51,5 +51,10 @@ alias cgrm='composer global remove' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' -# Add Composer's global binaries to PATH -export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) +# 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) +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 +fi -- cgit v1.2.3-70-g09d2 From d56cec1e8df19f67f665ff790b2fe2fb9ed59b50 Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Mon, 15 Oct 2018 00:29:23 +0530 Subject: Composer Readme added --- plugins/composer/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/composer/README.md (limited to 'plugins/composer') diff --git a/plugins/composer/README.md b/plugins/composer/README.md new file mode 100644 index 000000000..b0c38cf39 --- /dev/null +++ b/plugins/composer/README.md @@ -0,0 +1,31 @@ +# composer + +This plugin provides completion for [composer](https://getcomposer.org/), +as well as aliases for frequent composer commands. + +To use it add `composer` to the plugins array in your zshrc file. + +```zsh +plugins=(... composer) +``` + +## Aliases + +| Alias | Command | Description | +| ------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `c` | composer | Start composer, get help with composer commands | +| `csu` | composer self-update | Update composer to the latest version | +| `cu` | composer update | Update composer dependencies and `composer.lock` file | +| `cr` | composer require | Adds new packages to the `composer.json` file from current directory | +| `crm` | composer remove | Removes packages from the `composer.json` file from the current directory | +| `ci` | composer install | Reads the `composer.json` file from the current directory, resolves the dependencies, and installs them into `vendor` | +| `ccp` | composer create-project | Create new project from an existing package | +| `cdu` | composer dump-autoload | Update the autoloader due to new classes in a classmap package without having to go through an install or update | +| `cdo` | composer dump-autoload --optimize-autoloader | Convert PSR-0/4 autoloading to classmap to get a faster autoloader. Recommended especially for production, set `no` by default | +| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory | +| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory | +| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory | +| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | + + +The plugin adds Composer's global binaries to PATH, using Composer if available. -- cgit v1.2.3-70-g09d2 From f8ca1464b9d1792b2a6bc227c152197538b5ae9d Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 17 Oct 2018 20:34:58 +0200 Subject: reword --- plugins/composer/README.md | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'plugins/composer') diff --git a/plugins/composer/README.md b/plugins/composer/README.md index b0c38cf39..2b4bae579 100644 --- a/plugins/composer/README.md +++ b/plugins/composer/README.md @@ -1,7 +1,8 @@ # composer -This plugin provides completion for [composer](https://getcomposer.org/), -as well as aliases for frequent composer commands. +This plugin provides completion for [composer](https://getcomposer.org/), as well as aliases +for frequent composer commands. It also adds Composer's global binaries to the PATH, using +Composer if available. To use it add `composer` to the plugins array in your zshrc file. @@ -11,21 +12,18 @@ plugins=(... composer) ## Aliases -| Alias | Command | Description | -| ------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `c` | composer | Start composer, get help with composer commands | -| `csu` | composer self-update | Update composer to the latest version | -| `cu` | composer update | Update composer dependencies and `composer.lock` file | -| `cr` | composer require | Adds new packages to the `composer.json` file from current directory | -| `crm` | composer remove | Removes packages from the `composer.json` file from the current directory | -| `ci` | composer install | Reads the `composer.json` file from the current directory, resolves the dependencies, and installs them into `vendor` | -| `ccp` | composer create-project | Create new project from an existing package | -| `cdu` | composer dump-autoload | Update the autoloader due to new classes in a classmap package without having to go through an install or update | -| `cdo` | composer dump-autoload --optimize-autoloader | Convert PSR-0/4 autoloading to classmap to get a faster autoloader. Recommended especially for production, set `no` by default | -| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory | -| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory | -| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory | -| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | - - -The plugin adds Composer's global binaries to PATH, using Composer if available. +| Alias | Command | Description | +| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- | +| `c` | composer | Starts composer | +| `csu` | composer self-update | Updates composer to the latest version | +| `cu` | composer update | Updates composer dependencies and `composer.lock` file | +| `cr` | composer require | Adds new packages to `composer.json` | +| `crm` | composer remove | Removes packages from `composer.json` | +| `ci` | composer install | Resolves and installs dependencies from `composer.json` | +| `ccp` | composer create-project | Create new project from an existing package | +| `cdu` | composer dump-autoload | Updates the autoloader | +| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) | +| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory | +| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory | +| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory | +| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | -- cgit v1.2.3-70-g09d2