gulp-composer
Install composer packages from within gulp, even without composer itself installed on the system.
Install
npm i gulp-composer --save-dev
Requirements
-
PHP (obviously)
PHP 5.3.2 or above (at least 5.3.4 recommended to avoid potential bugs)
Recommended
Part of the magic of gulp-composer
is that having composer
installed on the system is not required! However, it is still recommended as it will increase performance of the task.
- By default,
gulp-composer
will search for composer in{working-dir}/composer.phar
. If it's not found, it will attempt to use the globally installedcomposer
command. - If
composer(.phar)
is still not found on the system, it will attempt to download it to the system temp directory. Future builds will check the system temp directory so it doesn't download it too often.
Usage
composer = ;;
Parameters
Parameter | Default | Description |
---|---|---|
command String |
install | The composer command to execute. See composer --help for list of available commands |
options Object |
see options | All options for gulp-composer and native composer |
Options
Option | Default | Description | Passed to composer |
---|---|---|---|
bin String |
auto | Path to the composer binary. E.g. composer , /usr/bin/composer.phar , or php /path/to/composer . |
No |
self-install Boolean |
true | Set to false to disable self-install. |
No |
async Boolean |
true | By default, the composer bin will load asynchronously. Use false to run it synchronously. |
No |
ansi Boolean |
true | The default for this parameter is automatically passed composer to enable logging in color. |
Yes |
working-dir String |
cwd | The path with which to run composer against (normally where the composer.json is located). | Yes |
... | mixed | Any other arguments will be passed through to composer | Yes |
Examples
Most basic setup:
var composer = ; gulp;
Most basic setup with self-install disabled:
var composer = ; gulp;
Adding a few options:
var composer = ; gulp;
A more complex setup:
var composer = gutils = ; // ... ;; if gutilsenvproduction ; else //default install ; ;
Contributors
- Tom Westcott tom.westcott@gmail.com
- Nathan J. Brauer nathan@marketera.com
- Joseph Richardson jrichardson@zingermans.com