File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/composer.cpython-310.pyc
o
�N�g<! � @ sb d Z ddlmZ dd� Z d
d d
�Z ddd�ZdS )a
Installation of Composer Packages
=================================
These states manage the installed packages for composer for PHP. Note that
either composer is installed and accessible via a bin directory or you can pass
the location of composer in the state.
.. code-block:: yaml
get-composer:
cmd.run:
- name: 'CURL=`which curl`; $CURL -sS https://getcomposer.org/installer | php'
- unless: test -f /usr/local/bin/composer
- cwd: /root/
install-composer:
cmd.wait:
- name: mv /root/composer.phar /usr/local/bin/composer
- cwd: /root/
- watch:
- cmd: get-composer
/path/to/project:
composer.installed:
- no_dev: true
- require:
- cmd: install-composer
# Without composer installed in your PATH
# Note: composer.phar must be executable for state to work properly
/path/to/project:
composer.installed:
- composer: /path/to/composer.phar
- php: /usr/local/bin/php
- no_dev: true
� )�
SaltExceptionc C s dt v rdS dS )zC
Only load if the composer module is available in __salt__
�composer.installT)Fz#composer module could not be loaded)�__salt__� r r �H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/composer.py�__virtual__+ s r NF�/rootTc C sB | ddi d�}t d | �}|du r|rd|d<