0

Excuse me if this sounds silly but I am quite new to composer. I try to install a repository distributed in Packagist, but I don't know how composer defines the location of the repositories required. If I install a repo on VCS, I can define the location by specifying target-dir, but this doesn't work for Packagist repos.

An example would be if I were to install a packagist called bugsnag/bugsnag, https://packagist.org/packages/bugsnag/bugsnag The location this repo would be installed in would be vendor/bugsnag/bugsnag/, it seems like the path follows the formation of the name of the repo, am I right?

Any suggestion would be appreciated!

Thanks!

Michael
  • 2,075
  • 7
  • 32
  • 46

1 Answers1

0

You are right.

Composer creates a directory named vendor in the directory where composer.json is located. Unless you have very strong technical requirements, you shouldn't change this location. "It's nicer if it's there" is no valid reason for me.

Below that directory every included vendor name is another directory level, and then the component name.

In general, you shouldn't care about the internal creation of files inside that directory too much. Composer helps you making some classes available, and in order for you to get them you include vendor/autoload.php as the only step. After that, everything is supposed to work.

Sven
  • 69,403
  • 10
  • 107
  • 109