PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 24, 2022

[FIXED] Composer - multiple repositories from one project

 January 24, 2022     composer-php, php     No comments   

Issue

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":  "git@bitbucket.org:vendor/my-private-repo1.git"
        },
        {
            "type": "vcs",
            "url":  "git@bitbucket.org: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":  "git@bitbucket.org:vendor/*"
        }
    ]
}

I hope my question is understandable. Thank you.


Solution

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).



Answered By - Jakub Zalas
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing