Skip to main content

Composer Modules Usage

This egg supports easy installation of PHP libraries using Composer.

How it works:

  • If a composer.json file exists in your server's root directory, it will be used automatically to install dependencies.
  • If composer.json is missing, the egg looks for a variable (e.g. COMPOSER_MODULES) with a space-separated list of Composer packages to install.
  • If neither composer.json nor COMPOSER_MODULES is set, Composer installation is skipped.

    Specifying Composer Modules manually:

    • Enter the packages in the COMPOSER_MODULES variable in this format:
    vendor/package[:version_constraint]

    Examples:

    • Latest stable version:
      symfony/http-foundation 
    • Specific version or range:
      monolog/monolog:^2.0 doctrine/orm:~2.10 nesbot/carbon:^2.50 
    • Multiple packages separated by spaces:
      symfony/http-foundation:^6.0 monolog/monolog guzzlehttp/guzzle 

    Notes:

  • Make sure package names and versions exist on Packagist.
  • Incorrect inputs can cause installation errors visible in the server console.
  • Installing many or complex packages can increase startup time.
  • Composer must be pre-installed in the container environment (this egg includes it)