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

Thursday, January 6, 2022

[FIXED] PHP Composer Global Configuration Private Repositories URL List

 January 06, 2022     composer-php, configuration, php, repository     No comments   

Issue

PHP Composer allows you to define it project's composer.json list of urls pointing to private repositories. Example:

{
    "require": {
        "vendor/my-private-repo": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@bitbucket.org:vendor/my-private-repo.git"
        }
    ]
}

But whenever I create a new private repo I need to edit all my projects and add that new repo URL to their composer.json before I am able to request that new package.

Is there any global composer configuration where I could store URLs to all of my private repos or even better where I can globally set an URL pointing to a resource that will have a list of all my private repos and their URLs up to date?


Solution

You could set all repositories in you Composer home directory (find where it is with composer config --global home). There is a config.json file in which you can add all the global repositories (global on that machine for all your projects).

See the docs on this file: https://getcomposer.org/doc/03-cli.md#composer-home-config-json

Unfortunately, you cannot have a central managed way for this out of the box. You could look into Composer Satis for this. With Satis you can host a single repository that references where all your packages are located (e.g. Bitbucket, GitHub or otherwise).



Answered By - 7ochem
  • 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