Composer (php)

$ curl -sS | php
$ mv composer.phar /usr/local/bin/composer
composer --prefer-dist install


  • composer install -h
  • composer update -h
  • composer require -h
  • composer update -vvv


      --prefer-source            Forces installation from package sources when possible, including VCS information.
      --prefer-dist              Forces installation from package dist even for dev versions.
      --dry-run                  Outputs the operations but will not execute anything (implicitly enables --verbose).
      --dev                      Enables installation of require-dev packages (enabled by default, only present for BC).
      --no-dev                   Disables installation of require-dev packages.
      --no-custom-installers     DEPRECATED: Use no-plugins instead.
      --no-autoloader            Skips autoloader generation
      --no-scripts               Skips the execution of all scripts defined in composer.json file.
      --no-progress              Do not output download progress.
      --no-suggest               Do not show package suggestions.
  -o, --optimize-autoloader      Optimize autoloader during autoloader dump
  -a, --classmap-authoritative   Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.
      --ignore-platform-reqs     Ignore platform requirements (php & ext- packages).
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug


php composer.phar require --prefer-dist yiisoft/yii2-gii "*"
php composer.phar require --prefer-dist kop/yii2-scroll-pager "dev-master"
php composer.phar require -vvv --prefer-dist webcreate/jquery-ias "dev-master"
  • --prefer-dist - Удаляет папку .git из модулей
php composer.phar remove skeeks/cms-shop
  • --prefer-dist - Не заливать репозиторий а взять из архива
"kop/yii2-scroll-pager": "dev-master"
php composer.phar show -i
php composer.phar update
COMPOSER_CACHE_DIR=/dev/null composer install
rm -rf "`composer config cache-dir`"
The "" file could not be downloaded: SSL operation failed with code 1. could not be fully loaded, package information was loaded from the local cache and may be out of date
$ php -i | grep -i ssl
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv2, tls, tlsv1.0, tlsv1.1, tlsv1.2
SSL => Yes
SSL Version => OpenSSL/1.0.2l
OpenSSL support => enabled
core SSL => supported
extended SSL => supported
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.0f  25 May 2017
OpenSSL Header Version => OpenSSL 1.1.0e  16 Feb 2017
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled
  • develop/php/composer.txt
  • Последнее изменение: 2018/10/29 01:14
  • mirocow