Saltstack Official PHP Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 9 години
преди 9 години
преди 9 години
преди 9 години
12345678910111213141516171819202122232425262728293031323334
  1. {% from "php/map.jinja" import php with context %}
  2. {% set install_file = php.local_bin + '/composer' %}
  3. include:
  4. - php
  5. get-composer:
  6. cmd.run:
  7. - name: 'CURL=`which curl`; $CURL -sS https://getcomposer.org/installer | php'
  8. - unless: test -f {{ install_file }}
  9. - cwd: {{ php.temp_dir }}
  10. - require:
  11. - pkg: php
  12. install-composer:
  13. cmd.wait:
  14. - name: mv {{ php.temp_dir }}/composer.phar {{ install_file }}
  15. - cwd: {{ php.temp_dir }}
  16. - watch:
  17. - cmd: get-composer
  18. # Get COMPOSER_DEV_WARNING_TIME from the installed composer, and if that time has passed
  19. # then it's time to run `composer selfupdate`
  20. #
  21. # It would be nice if composer had a command line switch to get this, but it doesn't,
  22. # and so we just grep for it.
  23. #
  24. update-composer:
  25. cmd.run:
  26. - name: "{{ install_file }} selfupdate"
  27. - unless: test $(grep --text COMPOSER_DEV_WARNING_TIME {{ install_file }} | egrep '^\s*define' | sed -e 's,[^[:digit:]],,g') \> $(php -r 'echo time();')
  28. - cwd: {{ php.temp_dir }}
  29. - require:
  30. - cmd: install-composer