mc_php / PHP tools

This state can be used to make some fun things with PHP. Like installing composer

install-global-php-composer:
  mc_php.composer:
    - name: /usr/local/bin/composer
    - installer: https://getcomposer.org/installer
    - update: False
mc_states.states.mc_php.composer_(name, installer=None, update=False)

Download composer.phar from the given url and install it on the given name. A check is done on the given name, if it’s already available nothing is done, except if update is set to True

name
Local file name of composer (like /usr/local/bin/composer)
installer
Distant name of composer phar installer source like https://getcomposer.org/installer which is the default
update
Boolean, whether to redo the install even if the program is already there or not.
mc_states.states.mc_php.composercommand(name, cwd=None, args=None, composer=None)

Run a composer command.

name
Command name (as reported by composer list –raw
cwd
Working directory, so also the directory of the composer.json file.
args
string of optionnal arguments for this command
composer
full path to composer, default is /usr/local/bin/composer