when I want to install some library by composer, it's enough to write:
composer require vendor/library
and composer downloads it from github. It's not necessary to give url for every "vendor/library" to composer.json. Composer does it "internally". But when I'd like to add some library from e.g. bitbucket, I have to create this composer.json:
{
"require": {
"vendor/my-private-repo1": "dev-master",
"vendor/my-private-repo2": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:vendor/my-private-repo1.git"
},
{
"type": "vcs",
"url": "[email protected]:vendor/my-private-repo2.git"
}
]
}
I have to specify an url of every library I want to install, even if they are from the same project. Is there any way to make it shorter? Can I do something like this:
{
"require": {
"vendor/my-private-repo1": "dev-master",
"vendor/my-private-repo2": "dev-master",
"vendor/my-private-repo3": "dev-master",
"vendor/my-private-repo4": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:vendor/*"
}
]
}
I hope my question is understandable. Thank you.
If you are working on a big project, then it is inevitable that you need to work with multiple repositories. That's why you need to sync your local code base with multiple Git remote repositories. For example, if your source code is: On Github for issues tracking.
You can add more repositories to your project by declaring them in composer. json . Repositories are only available to the root package and the repositories defined in your dependencies will not be loaded. Read the FAQ entry if you want to learn why.
Create an 'origin' remote pointing to your GitHub fork by using git clone. Create an 'upstream' remote pointing to a project main repository. Create an 'upstream-pull' remote containing a branch for every PR in the upstream repository. Create an 'origin-pull' remote containing a branch for every PR to your own ...
Private Packagist is a commercial package hosting product offering professional support and web based management of private and public packages, and granular access permissions.
You either need to specify each repository separately, or manage your composer packages with satis or toran proxy. You'll still need to define your repositories, but only once (in satis or toran).
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