Skip to content

Instantly share code, notes, and snippets.

@auipga
Forked from fprochazka/composer.php.ini
Last active October 25, 2018 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auipga/508a3221d70ac275a3eb86b9217e22c5 to your computer and use it in GitHub Desktop.
Save auipga/508a3221d70ac275a3eb86b9217e22c5 to your computer and use it in GitHub Desktop.
Composer with different ini or with different PHP

Hacking Composer

When you wanna

  • use different version of PHP for Composer (or other CLI apps)
  • use different php.ini with Composer, because of for example slow XDebug (that you don't even need with production phar of Composer)

Usage

  • save composer.sh as /usr/local/bin/composer
  • save composer.php.ini as /usr/local/etc/composer.php.ini, or create your own ini
  • chmod +x /usr/local/bin/composer
  • profit

Mods

  • You can easily change the used PHP runtime by changing the php binnary to an absolute path
[php]
memory_limit = -1
max_execution_time = 0
date.timezone = "Europe/Prague"
realpath_cache_size = "4096K"
extension=iconv.so
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 256
opcache.max_accelerated_files = 65407
opcache.validate_timestamps = false # keep in mind to flush the cache, once you update composer
opcache.save_comments = true
opcache.load_comments = true
opcache.max_file_size = 0
#!/bin/bash
php -n -c /usr/local/lib/composer.php.ini /usr/local/bin/composer.phar $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment