Use composer to install PHP dependencies for a directory
salt.modules.composer.
did_composer_install
(dir)¶Test to see if the vendor directory exists in this directory
Directory location of the composer.json file
CLI Example:
salt '*' composer.did_composer_install /var/www/application
salt.modules.composer.
install
(directory, composer=None, php=None, runas=None, prefer_source=None, prefer_dist=None, no_scripts=None, no_plugins=None, optimize=None, no_dev=None, quiet=False, composer_home='/root', env=None)¶Install composer dependencies for a directory.
If composer has not been installed globally making it available in the
system PATH & making it executable, the composer
and php
parameters
will need to be set to the location of the executables.
Directory location of the composer.json file.
Location of the composer.phar file. If not set composer will just execute "composer" as if it is installed globally. (i.e. /path/to/composer.phar)
Location of the php executable to use with composer. (i.e. /usr/bin/php)
Which system user to run composer as.
--prefer-source option of composer.
--prefer-dist option of composer.
--no-scripts option of composer.
--no-plugins option of composer.
--optimize-autoloader option of composer. Recommended for production.
--no-dev option for composer. Recommended for production.
--quiet option for composer. Whether or not to return output from composer.
$COMPOSER_HOME environment variable
A list of environment variables to be set prior to execution.
CLI Example:
salt '*' composer.install /var/www/application
salt '*' composer.install /var/www/application no_dev=True optimize=True
salt.modules.composer.
selfupdate
(composer=None, php=None, runas=None, quiet=False, composer_home='/root')¶Update composer itself.
If composer has not been installed globally making it available in the
system PATH & making it executable, the composer
and php
parameters
will need to be set to the location of the executables.
Location of the composer.phar file. If not set composer will just execute "composer" as if it is installed globally. (i.e. /path/to/composer.phar)
Location of the php executable to use with composer. (i.e. /usr/bin/php)
Which system user to run composer as.
--quiet option for composer. Whether or not to return output from composer.
$COMPOSER_HOME environment variable
CLI Example:
salt '*' composer.selfupdate
salt.modules.composer.
update
(directory, composer=None, php=None, runas=None, prefer_source=None, prefer_dist=None, no_scripts=None, no_plugins=None, optimize=None, no_dev=None, quiet=False, composer_home='/root', env=None)¶Update composer dependencies for a directory.
If composer install has not yet been run, this runs composer install instead.
If composer has not been installed globally making it available in the
system PATH & making it executable, the composer
and php
parameters
will need to be set to the location of the executables.
Directory location of the composer.json file.
Location of the composer.phar file. If not set composer will just execute "composer" as if it is installed globally. (i.e. /path/to/composer.phar)
Location of the php executable to use with composer. (i.e. /usr/bin/php)
Which system user to run composer as.
--prefer-source option of composer.
--prefer-dist option of composer.
--no-scripts option of composer.
--no-plugins option of composer.
--optimize-autoloader option of composer. Recommended for production.
--no-dev option for composer. Recommended for production.
--quiet option for composer. Whether or not to return output from composer.
$COMPOSER_HOME environment variable
A list of environment variables to be set prior to execution.
CLI Example:
salt '*' composer.update /var/www/application
salt '*' composer.update /var/www/application no_dev=True optimize=True