Here's the basic story: I develop some package that I also use in projects. Those packages are published to packagist, and when I use them in my projects, I just require them as any other package.
When the projects are on the development server, it's all good, they get the latest version and just works.
But when I'm developing, I find that waiting for packagist to update, and requiring do go composer update
everytime I do something over my package is a bit of a waste of time... Normally, I'd setup a custom vcs
repository pointing to the local path on my hard drive and be done with it, but doing so I need to keep in mind that I have to remove said local repository before pushing to production.
What's I'd like to achieve (if possible, or something that would do the same!) is to have some package in the require
section of my composer.json
to use packagist when in prodcution, and have the require-dev
section to only use the local repository.
Is that possible? I honestly could not find anything related to that in the docs... Or I just misread the usage of it all.
I'm adding this a solution, but will keep the question unanswered for a while hoping for vanilla solution.
Basically, I can achieve what I wanted using this package. What it does is help you specify local paths to look for packages and steps in when you are doing composer update. And since this is only locally installed (with composer global
), it leaved the production server to normally resolves the package with packagist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With