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

Monday, January 31, 2022

[FIXED] composer.json recursive dependencies

 January 31, 2022     composer-php, module, php     No comments   

Issue

I'm trying to manage my personal packages via Composer and I'm getting some errors when I "composer update/install" a module (which depends on another module which depends on another module, etc).

I have a composer.json file in my Admin module which references and requires a personal repository "Access" :

"repositories": [
        {
            "type": "vcs",
            "url": "git@gitlab.[hidden].com:[hidden]/php-zf2-access.git"
        },
],
"require": {
        [hidden]/php-zf2-access": "dev-master"
}

My Access module has a composer.json file which references and requires a personal repository Basic :

"repositories": [
        {
            "type": "vcs",
            "url": "git@gitlab.[hidden].com:[hidden]/php-zf2-basic.git"
        }
    ],
"require": {
        "[hidden]/php-zf2-basic": "dev-master"
    },

When I'm installing/updating my Admin module, I get this error :

Your requirements could not be resolved to an installable set of packages.

Problem 1

- Installation request for [hidden]/php-zf2-access dev-master -> satisfiable by [hidden]/php-zf2-access[dev-master].

- [hidden]/php-zf2-access dev-master requires [hidden]/php-zf2-basic dev-master -> no matching package found.

If I "composer install" my Access module, it correctly loads my Basic module (no configuration error in my composer.json Access module), so why my Admin module can't load Access which loads Basic ?

If I add my Basic module configuration (repositories : ....basic.git + require: .....basic:"dev-master") to my composer.json's Admin module, no error is raised and the installation runs perfectly (but I don't want this as a solution).

Thank you for your help.


Solution

Composer can not load repositories recursively. The easiest if you have private packages to manage that have dependencies on each other is to use Toran Proxy or Satis.



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