How does installing packages from the same vendor work on Composer?

Asked

Viewed 30 times

0

I have a question, let’s assume that I have two libraries (different packages) that can be installed via name in the Composer.json file is respectively:

  • Enterprise/financial
  • Company/teams

The first has autoload:

"autoload": {
    "psr-4": {
        "financeiro\\": "empresa/financeiro/"
        }
}

The other autoload has:

"autoload": {
    "psr-4": {
        "equipe\\": "empresa/equipe/"
        }
}

If I apply a Composer install business/financial and then do the same with team, both will be below /vendor/company? And autoload, will be merged into a single json file?

  • Both are in the same directory, already autoload, Poser mounts following the repository’s Composer.json, it does not merge, but knows which company/team is in one directory and company/financial in another.

  • Then within the autoload->by-4 we would have two correct lines, one for company/team and another for company/financial?

  • I think it’s much more complex than that, Fabio. The important thing is that, as @lvcs mentioned, Composer takes care of it, separates the namespaces correctly and even if they are within the same directory, you don’t have to worry.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.