HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/composer.cpython-310.pyc
o

�N�g<!�@sbdZddlmZdd�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
�)�
SaltExceptioncCsdtvrdSdS)zC
    Only load if the composer module is available in __salt__
    �composer.installT)Fz#composer module could not be loaded)�__salt__�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/composer.py�__virtual__+srNF�/rootTcCsB|ddid�}td|�}|dur|rd|d<d|d	<|Std
durJ|dur*d}nd}d|�d
�|d	<d|�d|��d|��d�|d<d|d<|Sztd||||||||||	|
||
d�
}Wn"ty�}zd|d<d|�d|��|d	<|WYd}~Sd}~wwd|d<|
dur�d|d	<|Sd|d	<|d|dd�|d<|S)a�
    Verify that the correct versions of composer dependencies are present.

    name
        Directory location of the ``composer.json`` file.

    composer
        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``)

    php
        Location of the php executable to use with composer.
        (i.e. ``/usr/bin/php``)

    user
        Which system user to run composer as.

        .. versionadded:: 2014.1.4

    prefer_source
        ``--prefer-source`` option of composer.

    prefer_dist
        ``--prefer-dist`` option of composer.

    no_scripts
        ``--no-scripts`` option of composer.

    no_plugins
        ``--no-plugins`` option of composer.

    optimize
        ``--optimize-autoloader`` option of composer. Recommended for production.

    no_dev
        ``--no-dev`` option for composer. Recommended for production.

    quiet
        ``--quiet`` option for composer. Whether or not to return output from composer.

    composer_home
        ``$COMPOSER_HOME`` environment variable

    always_check
        If ``True``, *always* run ``composer install`` in the directory.  This is the
        default behavior.  If ``False``, only run ``composer install`` if there is no
        vendor directory present.

    env
        A list of environment variables to be set prior to execution.
    N���name�result�comment�changes�composer.did_composer_installFTrz)Composer already installed this directoryr
�testznot �The state of "�" will be changed.zcomposer install has zbeen run in z composer install will be run in ��old�newrr��composer�phpZrunas�
prefer_source�prefer_dist�
no_scripts�
no_plugins�optimize�no_dev�quiet�
composer_home�env�Error executing composer in '�': zFComposer install completed successfully, output silenced by quiet flagz'Composer install completed successfully�stderr�stdout�r$r%�rZ__opts__r)rrr�userrrrrrrrr Zalways_checkr!�retZdid_installZinstall_status�call�errrrr�	installed4s\D
�
�����r,c
Cs|ddid�}
td|�}|rd|��}nd|��}tddur8d	|�d
�|
d<|d|��d
�|
d<d|
d<|
Sztd||||||||||	|
||d�
}Wn"tyo}zd|
d<d|�d|��|
d<|
WYd}~Sd}~wwd|
d<|
dur~d|
d<|
Sd|
d<|d|dd�|
d<|
S)a�
    Composer update the directory to ensure we have the latest versions
    of all project dependencies.

    name
        Directory location of the ``composer.json`` file.

    composer
        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)

    php
        Location of the php executable to use with composer.
        (i.e. ``/usr/bin/php``)

    user
        Which system user to run composer as.

        .. versionadded:: 2014.1.4

    prefer_source
        ``--prefer-source`` option of composer.

    prefer_dist
        ``--prefer-dist`` option of composer.

    no_scripts
        ``--no-scripts`` option of composer.

    no_plugins
        ``--no-plugins`` option of composer.

    optimize
        ``--optimize-autoloader`` option of composer. Recommended for production.

    no_dev
        ``--no-dev`` option for composer. Recommended for production.

    quiet
        ``--quiet`` option for composer. Whether or not to return output from composer.

    composer_home
        ``$COMPOSER_HOME`` environment variable

    env
        A list of environment variables to be set prior to execution.
    Nr	r
rz)composer install has not yet been run in z!composer install has been run in rTrrr
z'composer install/update will be run in rrrzcomposer.updaterFr"r#zEComposer update completed successfully, output silenced by quiet flagz&Composer update completed successfullyr$r%r&r')rrrr(rrrrrrrr r!r)Zis_installedZ
old_statusr*r+rrr�update�sT?

�
�����r-)
NNNNNNNNNFrTN)NNNNNNNNNFrN)�__doc__Zsalt.exceptionsrrr,r-rrrr�<module>s>'
��