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!

4

1 回答 1

0

你说的对。

Composer 会创建一个以vendor所在目录命名的目录composer.json。除非您有非常严格的技术要求,否则不应更改此位置。“如果有它会更好”对我来说没有正当理由。

在该目录下,每个包含的供应商名称都是另一个目录级别,然后是组件名称。

一般来说,您不应该太关心该目录中文件的内部创建。Composer 可以帮助您提供一些课程,并且为了让您获得它们,您将其vendor/autoload.php作为唯一的步骤。在那之后,一切都应该工作。

于 2013-11-16T10:36:25.330 回答