3

I have a local repository set up in my global config, which I develop composer packages in. This way I can easily test them out in multiple locations by simply running composer require my/package. When I release these packages, I'd like to be able to keep the local copy, but select from which repository I can require these. Is this possible? Something like:

composer require --repository local my/package

composer require --repository my-satis-instance my/package

Ambidex
  • 755
  • 1
  • 5
  • 27
  • I would say no. Because you overloaded the original repository with your own local repository. So it always uses the local over the original. The only way I see is to remove it from the repositories section. – Pᴇʜ Feb 16 '17 at 09:20
  • 1
    That's a real shame... It would really speed up my development workflow. – Ambidex Feb 17 '17 at 14:02

1 Answers1

1

Why not deal with the versions?

Usually I would use a stable version like 1.0.3 in production but dev-master in development mode. This way you can switch easily between actual development and stable.

Therefore it doesn't matter if you use the local or the public repo. Because stable versions should be the same in public and local repos. Once published as a version this version never changes again (changes would increase version number).

So e.g. if you switch on local repo from dev-master to 1.0.3 it should be the same as if you switched to public repo 1.0.3. So you can keep your local repo in your dev environment.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73