且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

作曲家-私有软件包未进入自动装带器

更新时间:2023-11-17 11:13:22

如果使用 package 类型,那么在该 package 描述中必须提及Composer关于该库的所有信息,包括自动加载和任何其他要求。

If you include your library in an application by using the package type, then everything Composer knows about that library has to be mentioned in that package description, including the autoloading and any other requirements.

通常,仅当您不能更改代码来源时,才应使用此软件包。幸运的是,您可以完全控制库的存储库,只需将Composer指向它即可。

Usually this package should only be used if you cannot change the source where the code is coming from. Luckily, you have full control over the repository of your library, you should simply point Composer to it.

"repositories": [{
    "type": "vcs",
    "url": "ssh://git@somewhere/path/repo.git"
}]

使用此示例代替 type: package ,Composer将联系存储库并读取它的 composer.json ,检测所有依赖项和自动加载,然后像安装任何外部软件包一样安装它。

Use this example instead of "type": "package", and Composer will contact the repository and read it's composer.json, detect all dependencies and the autoloading, and install it just like any external package.

请注意,您必须添加您使用的每个内部存储库。 Composer不遵循库的存储库指针,它们都必须在应用程序的根 composer.json 中复制

Note that you have to add every internal repository that you use. Composer does not follow the library's repository pointers, they all have to be duplicated in the root composer.json of your application.