3

I want to include local repository with versions. I have following folder structure.

+myapp
-composer.json
+libs
--lib1
---composer.json
--lib2
---composer.json

I need to add different version of lib1 and lib2 to include in myapp composer.json file. How could I add version information to composer local repositories?

Aruna
  • 701
  • 10
  • 26
  • I guess it supports only one version, see the related post here - https://stackoverflow.com/questions/27150695/how-does-composer-handle-multiple-versions-of-the-same-package?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Mahesh Jun 12 '18 at 04:20

1 Answers1

1

You need to add version into composer.json files of these libraries. For example:

libs/lib1/composer.json:

{
    "name": "me/lib1",
    "version": "1.2.2",
    ...

libs/lib2/composer.json:

{
    "name": "me/lib2",
    "version": "1.3.2",
    ...

Then explicitly update these libraries:

composer update me/lib1
composer update me/lib2

Declared versions should be saved into composer.lock and installed.json.

rob006
  • 21,383
  • 5
  • 53
  • 74