phive icon indicating copy to clipboard operation
phive copied to clipboard

Ignore installed PHARs in composer

Open heiglandreas opened this issue 1 year ago • 0 comments

It is possible to create a separate composer.json file that contains a replace section that defines composer packages that this composer.json file replaces.

This file can automatically be injected into an existing composer.json by

a) Adding a new repositories entry of type file that references .phive b) Requiring the project so that.composer knows of it.

The second step is then to add a package to the replace section when installing it via phive.

That way it is possible to use tools via phive and still install packages for them without installing the tool a second time via composer.

This will require phive to check on every call to install whether the necessary files are in place (if not install them) and then add the package to the composer.json

I'd recommend creating a unique identifier when creating the phive.xml file and adding that to the file. That identifier can then be used to name the .phive/composer.json project. The name would then be something like phive/customproject_<unique-id>.

heiglandreas avatar Jan 22 '23 18:01 heiglandreas