NotGaeL
NotGaeL

Reputation: 8504

proper use of composer create-project to code and commit on project dependencies

I have a PHP project with some 3rd party developed dependencies and some developed by myself.

Some times I happen to find a bug on one of the dependencies I maintain and want to patch it on the spot or code some extra functionality that fits the main project needs.

Right now I am coding on the module project, doing a commit and then a composer update on the main project's composer.json, whose source for the module is the remote repo.

I would like to be able to have the full dependency repos on the main project, or at least commit to local and get the update without pushing to remote.

I believe I can use composer create-project for that, but the problem is I also get a lot of rubbish (the 3rd party dependency repos) that make my project huge.

Is there any way to have a composer create-project that only downloads the full repo of the dependencies I choose (those developed by myself)? Or to have the repo url point to a local git repository folder instead of a remote one?

Upvotes: 0

Views: 167

Answers (1)

Estus Flask
Estus Flask

Reputation: 223288

According to the manual, create-project

is the equivalent of doing a git clone/svn checkout followed by a "composer install" of the vendors.

Considering that, you run

composer create-project --no-install

Then you add local repos in composer.json (I'm not sure if it is documented but you can provide absolute and relative local paths as repo url) and do

composer install

Upvotes: 1

Related Questions