diff --git a/LINKS.md b/LINKS.md index fa39680..dcc1c5a 100644 --- a/LINKS.md +++ b/LINKS.md @@ -1,20 +1,23 @@ -# Links +# 参考链接 -In this page, we provide the quick reference link can help you increase ability to learning and coding. +在项目的推进过程中,总会参考其他用户和网站的资源。 -## JDK +在这个页面中对相关的资源提供快速参考的链接。 -| Webiste | Links | -|---------|-----------------------------------------------------| -| Oracle | https://www.oracle.com/java/technologies/downloads/ | -| OpenJDK | https://adoptium.net/temurin/releases/ | +## 中文历史 Fork 仓库 +文档中的内容没有完全重新开始构建,我们是在基于 https://github.com/5-say/composer-doc-cn 仓库的基础上进行更新的。 -## Useful Links +主要的原因是因为当前项目的需要我们也需要使用 composer 项目,但中文文档也比较来了。 -| Webiste | Links | -|----------------|-------------------------------------------------| -| Eclipse | https://www.eclipse.org/ | -| GitHub | https://github.com/ | -| stackoverflow | https://stackoverflow.com/questions/tagged/java | -| Apache Commons | https://commons.apache.org/ | \ No newline at end of file +对用户来说,其实也没有关系了,因为用的命令也就那么几个,但我们想利用这个契机把文档和我们的问题更新一下。 + +## 参考网站列表 + +对在使用 composer 内容比较多的网站,我们在次列出。 + +| 网站名称 | 链接 | +|---------------|------------------------------------------| +| iSharkFly | https://www.isharkfly.com/tag/composer | +| Laravel中文网 | http://www.golaravel.com | +| Composer 中文文档 | https://github.com/5-say/composer-doc-cn | \ No newline at end of file diff --git a/README.md b/README.md index fb80c38..756a407 100644 --- a/README.md +++ b/README.md @@ -22,27 +22,27 @@ Composer 中文文档 - [社区](/cn-introduction/06-community.md) ## Articles -- [别名](/cn-introduction/articles/aliases.md) +- [别名](/articles/aliases.md) 版本分支名称的别名。 -- [自定义安装程序](/cn-introduction/articles/custom-installers.md) +- [自定义安装程序](/articles/custom-installers.md) 修改某些特殊类型包的安装方式。 -- [Handling Private Packages With Satis](/cn-introduction/articles/handling-private-packages-with-satis.md) +- [Handling Private Packages With Satis](/articles/handling-private-packages-with-satis.md) Host your own composer repository -- [插件](/cn-introduction/articles/plugins.md) +- [插件](/articles/plugins.md) 修改和扩展 Composer 的功能。 -- [脚本](/cn-introduction/articles/scripts.md) +- [脚本](/articles/scripts.md) 脚本是指一些 Composer 事件的回调,它们在安装资源包的过程中被触发执行。 -- [Troubleshooting](/cn-introduction/articles/troubleshooting.md) +- [Troubleshooting](/articles/troubleshooting.md) Solving problems -- [二进制供应库](/cn-introduction/articles/vendor-binaries.md) +- [二进制供应库](/articles/vendor-binaries.md) 从资源包中暴露命令行脚本。 ## FAQs -- [如何为我的框架自定义一个资源包安装目录?](/cn-introduction/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md) -- [我应该提交 vendor 目录中的依赖包吗?](/cn-introduction/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md) -- [为什么说“比较符”和“通配符”相结合的版本约束是坏主意?](/cn-introduction/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md) -- [为什么 Composer 不递归加载储存库?](/cn-introduction/faqs/why-can%27t-composer-load-repositories-recursively.md) +- [如何为我的框架自定义一个资源包安装目录?](/faq/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md) +- [我应该提交 vendor 目录中的依赖包吗?](/faq/should-i-commit-the-dependencies-in-my-vendor-directory.md) +- [为什么说“比较符”和“通配符”相结合的版本约束是坏主意?](/faq/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md) +- [为什么 Composer 不递归加载储存库?](/faq/why-can%27t-composer-load-repositories-recursively.md) ## 相关文章推荐 diff --git a/_sidebar.md b/_sidebar.md index 7f07b2a..c077052 100644 --- a/_sidebar.md +++ b/_sidebar.md @@ -1,11 +1,10 @@ -- HIS 医疗数据信息化 - - [Readme](README.md) - - [Contact](CONTACT.md) -- [FHIR In Action](fhir-in-action/index.md) +- Composer 中文文档 + - [项目自述](README.md) + - [联系我们](CONTACT.md) + - [参考链接](LINKS.md) - [Week 2](week-2/index.md) - [Week 3](week-3/index.md) - [Week 4](week-4/_index.md) - Week 5 - Week 6 -- Week 7 -- [Links](LINKS.md) \ No newline at end of file +- [FAQ](faq/_index.md) diff --git a/fhir-in-action/index.md b/articles/_index.md similarity index 99% rename from fhir-in-action/index.md rename to articles/_index.md index cafe06f..450a0b1 100644 --- a/fhir-in-action/index.md +++ b/articles/_index.md @@ -1,4 +1,4 @@ -# FHIR In Action +# 相关文章 --- 针对 FHIR 标准的指南和示例以及相关内容的讨论。 diff --git a/articles/_sidebar.md b/articles/_sidebar.md new file mode 100644 index 0000000..f444f5a --- /dev/null +++ b/articles/_sidebar.md @@ -0,0 +1,9 @@ +- [FHIR 简介](/fhir-in-action/introduction/index.md) + - [开发者眼中的 FHIR](/fhir-in-action/introduction/toreader.md) + - [FHIR 实现](/fhir-in-action/introduction/fhir-mplementation.md) + - [FHIR 概述](/fhir-in-action/introduction/fhir-overview.md) + - [FHIR 开发者指南](/fhir-in-action/introduction/fhir-dev-guide.md) + - [开放数据](/fhir-in-action/introduction/open-data-is-coming.md) +- [Install JDK](/fhir-in-action/install_jdk.md) +- [Install Eclipse](/fhir-in-action/introduction/install_eclipse.md) +- [Naming Conventions](/fhir-in-action/naming_conventions.md) \ No newline at end of file diff --git a/cn-introduction/articles/aliases.md b/articles/aliases.md similarity index 100% rename from cn-introduction/articles/aliases.md rename to articles/aliases.md diff --git a/cn-introduction/articles/custom-installers.md b/articles/custom-installers.md similarity index 98% rename from cn-introduction/articles/custom-installers.md rename to articles/custom-installers.md index cb532d2..e77f38b 100644 --- a/cn-introduction/articles/custom-installers.md +++ b/articles/custom-installers.md @@ -158,8 +158,8 @@ class TemplateInstaller extends LibraryInstaller > _并非安装在 `/vendor` 目录,任何使用这个安装程序的资源包,将被放置在 `/data/templates/` 目录中。_ -[1]: ../04-schema.md#type -[2]: ../04-schema.md#extra +[1]: ../cn-introduction/04-schema.md#type +[2]: ../cn-introduction/04-schema.md#extra [3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php [4]: https://github.com/composer/composer/blob/master/src/Composer/Installer/InstallerInterface.php [5]: https://github.com/composer/composer/blob/master/src/Composer/Installer/LibraryInstaller.php diff --git a/cn-introduction/articles/handling-private-packages-with-satis.md b/articles/handling-private-packages-with-satis.md similarity index 97% rename from cn-introduction/articles/handling-private-packages-with-satis.md rename to articles/handling-private-packages-with-satis.md index 6988441..c78d502 100644 --- a/cn-introduction/articles/handling-private-packages-with-satis.md +++ b/articles/handling-private-packages-with-satis.md @@ -18,10 +18,10 @@ Satis 是一个静态的 `composer` 代码库生成器。 For example let's assume you have a few packages you want to reuse across your company but don't really want to open-source. You would first define a Satis configuration: a json file with an arbitrary name that lists your curated -[repositories](../05-repositories.md). +[repositories](../cn-introduction/05-repositories.md). Here is an example configuration, you see that it holds a few VCS repositories, -but those could be any types of [repositories](../05-repositories.md). Then it +but those could be any types of [repositories](../cn-introduction/05-repositories.md). Then it uses `"require-all": true` which selects all versions of all packages in the repositories you defined. diff --git a/cn-introduction/articles/plugins.md b/articles/plugins.md similarity index 97% rename from cn-introduction/articles/plugins.md rename to articles/plugins.md index f5fbb3f..e7464fe 100644 --- a/cn-introduction/articles/plugins.md +++ b/articles/plugins.md @@ -124,10 +124,10 @@ class AwsPlugin implements PluginInterface, EventSubscriberInterface > 你可以通过 `--no-plugins` 选项让 composer 的命令禁用所有已经安装的插件。这或许是特别有用的,如果任何插件会导致错误,而你想要升级或卸载它。 -[1]: ../04-schema.md#type -[2]: ../04-schema.md#extra +[1]: ../cn-introduction/04-schema.md#type +[2]: ../cn-introduction/04-schema.md#extra [3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php [4]: https://github.com/composer/composer/blob/master/src/Composer/Composer.php [5]: https://github.com/composer/composer/blob/master/src/Composer/IO/IOInterface.php [6]: https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/EventSubscriberInterface.php -[7]: ./scripts.md#event-names +[7]: scripts.md#event-names diff --git a/cn-introduction/articles/scripts.md b/articles/scripts.md similarity index 100% rename from cn-introduction/articles/scripts.md rename to articles/scripts.md diff --git a/cn-introduction/articles/troubleshooting.md b/articles/troubleshooting.md similarity index 94% rename from cn-introduction/articles/troubleshooting.md rename to articles/troubleshooting.md index 838b761..ef63aa6 100644 --- a/cn-introduction/articles/troubleshooting.md +++ b/articles/troubleshooting.md @@ -7,11 +7,11 @@ This is a list of common pitfalls on using Composer, and how to avoid them. ## General -1. Before asking anyone, run [`composer diagnose`](../03-cli.md#diagnose) to check +1. Before asking anyone, run [`composer diagnose`](../cn-introduction/03-cli.md#diagnose) to check for common problems. If it all checks out, proceed to the next steps. 2. When facing any kind of problems using Composer, be sure to **work with the - latest version**. See [self-update](../03-cli.md#self-update) for details. + latest version**. See [self-update](../cn-introduction/03-cli.md#self-update) for details. 3. Make sure you have no problems with your setup by running the installer's checks via `curl -sS https://getcomposer.org/installer | php -- --check`. @@ -27,7 +27,7 @@ This is a list of common pitfalls on using Composer, and how to avoid them. branches and tag names. 2. Be sure to **set the right - [minimum-stability](../04-schema.md#minimum-stability)**. To get started or be + [minimum-stability](../cn-introduction/04-schema.md#minimum-stability)**. To get started or be sure this is no issue, set `minimum-stability` to "dev". 3. Packages **not coming from [Packagist](https://packagist.org/)** should diff --git a/cn-introduction/articles/vendor-binaries.md b/articles/vendor-binaries.md similarity index 100% rename from cn-introduction/articles/vendor-binaries.md rename to articles/vendor-binaries.md diff --git a/cn-introduction/02-libraries.md b/cn-introduction/02-libraries.md index e716db4..0adde66 100644 --- a/cn-introduction/02-libraries.md +++ b/cn-introduction/02-libraries.md @@ -110,7 +110,7 @@ hg) 的信息推断出包的版本,因此你不必手动指明版本号,并 它表示一个包版本的别名。例如,你可以为 `dev-master` 设置别名 `1.0.x-dev`,这样就可以通过 require `1.0.x-dev` 来得到 `dev-master` 版本的包。 -详细请查看[“别名”](articles/aliases.md)。 +详细请查看[“别名”](../articles/aliases.md)。 ## 锁文件 diff --git a/cn-introduction/03-cli.md b/cn-introduction/03-cli.md index bc28218..5c01531 100644 --- a/cn-introduction/03-cli.md +++ b/cn-introduction/03-cli.md @@ -434,7 +434,7 @@ php composer.phar create-project doctrine/orm path 2.2.* ## 执行脚本 `run-script` -你可以运行此命令来手动执行 [脚本](articles/scripts.md),只需要指定脚本的名称,可选的 `--no-dev` 参数允许你禁用开发者模式。 +你可以运行此命令来手动执行 [脚本](../articles/scripts.md),只需要指定脚本的名称,可选的 `--no-dev` 参数允许你禁用开发者模式。 ## 诊断 `diagnose` @@ -498,7 +498,7 @@ COMPOSER=composer-other.json php composer.phar install ### COMPOSER_BIN_DIR -通过设置这个环境变量,你可以指定 `bin`([Vendor Binaries](articles/vendor-binaries.md))目录到 `vendor/bin` 以外的其它目录。 +通过设置这个环境变量,你可以指定 `bin`([Vendor Binaries](../articles/vendor-binaries.md))目录到 `vendor/bin` 以外的其它目录。 ### http_proxy or HTTP_PROXY diff --git a/cn-introduction/04-schema.md b/cn-introduction/04-schema.md index bedc4e5..d7f4d88 100644 --- a/cn-introduction/04-schema.md +++ b/cn-introduction/04-schema.md @@ -120,7 +120,7 @@ composer 原生支持以下4种类型: - **library:** 这是默认类型,它会简单的将文件复制到 `vendor` 目录。 - **project:** 这表示当前包是一个项目,而不是一个库。例:框架应用程序 [Symfony standard edition](https://github.com/symfony/symfony-standard),内容管理系统 [SilverStripe installer](https://github.com/silverstripe/silverstripe-installer) 或者完全成熟的分布式应用程序。使用 IDE 创建一个新的工作区时,这可以为其提供项目列表的初始化。 - **metapackage:** 当一个空的包,包含依赖并且需要触发依赖的安装,这将不会对系统写入额外的文件。因此这种安装类型并不需要一个 dist 或 source。 -- **composer-plugin:** 一个安装类型为 `composer-plugin` 的包,它有一个自定义安装类型,可以为其它包提供一个 installler。详细请查看 [自定义安装类型](articles/custom-installers.md)。 +- **composer-plugin:** 一个安装类型为 `composer-plugin` 的包,它有一个自定义安装类型,可以为其它包提供一个 installler。详细请查看 [自定义安装类型](../articles/custom-installers.md)。 仅在你需要一个自定义的安装逻辑时才使用它。建议忽略这个属性,采用默认的 `library`。 @@ -334,7 +334,7 @@ composer 原生支持以下4种类型: > 正因为如此,在某些情况下,它不会是一个实用的解决方法, > 如果可能,你应该总是尝试切换到拥有标签的版本。 -它也可以应用于行内别名,这样它将匹配一个约束,否则不会。更多信息请参考 [别名](articles/aliases.md)。 +它也可以应用于行内别名,这样它将匹配一个约束,否则不会。更多信息请参考 [别名](../articles/aliases.md)。 #### require @@ -694,7 +694,7 @@ Repositories 并不是递归调用的,只能在“Root包”的 `composer.json * **github-oauth:** 一个域名和 oauth keys 的列表。 例如:使用 `{"github.com": "oauthtoken"}` 作为此选项的值, 将使用 `oauthtoken` 来访问 github 上的私人仓库,并绕过 low IP-based rate 的 API 限制。 - [关联知识](articles/troubleshooting.md#api-rate-limit-and-oauth-tokens) + [关联知识](../articles/troubleshooting.md#api-rate-limit-and-oauth-tokens) 关于如何获取 GitHub 的 OAuth token。 * **vendor-dir:** 默认为 `vendor`。通过设置你可以安装依赖到不同的目录。 * **bin-dir:** 默认为 `vendor/bin`。如果一个项目包含二进制文件,它们将被连接到这个目录。 @@ -727,7 +727,7 @@ Repositories 并不是递归调用的,只能在“Root包”的 `composer.json Composer 允许你在安装过程中的各个阶段挂接脚本。 -更多细节和案例请查看 [脚本](articles/scripts.md)。 +更多细节和案例请查看 [脚本](../articles/scripts.md)。 ### extra @@ -747,7 +747,7 @@ $extra = $event->getComposer()->getPackage()->getExtra(); 该属性用于标注一组应被视为二进制脚本的文件,他们会被软链接到(config 对象中的)`bin-dir` 属性所标注的目录,以供其他依赖包调用。 -详细请查看 [Vendor Binaries](articles/vendor-binaries.md)。 +详细请查看 [Vendor Binaries](../articles/vendor-binaries.md)。 可选。 diff --git a/cn-introduction/05-repositories.md b/cn-introduction/05-repositories.md index 9c2fe61..8bde2e5 100644 --- a/cn-introduction/05-repositories.md +++ b/cn-introduction/05-repositories.md @@ -59,7 +59,7 @@ Composer 是一个依赖管理工具。它在本地安装一些资源包。一 默认情况下已经将 Packagist.org 注册到 Composer。你可以在 `composer.json` 中申明更多的资源库,把它们加入你的项目中。 -资源库的定义仅可用于“root 包”,而在你依赖的包中定义的资源库将不会被加载。如果你想了解其中的原因,请阅读 [FAQ entry](faqs/why-can't-composer-load-repositories-recursively.md)。 +资源库的定义仅可用于“root 包”,而在你依赖的包中定义的资源库将不会被加载。如果你想了解其中的原因,请阅读 [FAQ entry](../faq/why-can't-composer-load-repositories-recursively.md)。 ## Types @@ -241,7 +241,7 @@ VCS 表示版本控制系统。这包括像 git、svn 或 hg 这样的版本管 注意,你不应该对包进行重命名,除非你真的打算摆脱原来的包,并长期的使用你自己的 fork。这样 Composer 就会正确获取你的包了。如果你确定要重命名这个包,你应该在默认分支(通常是 master 分支)上操作,而不是特性分支,因为包的名字取自默认分支。 -如果其它包依赖你 fork 的这个分支,可能要对它做版本号的行内别名设置,才能够准确的识别版本约束。更多相关信息请查看 [别名](articles/aliases.md)。 +如果其它包依赖你 fork 的这个分支,可能要对它做版本号的行内别名设置,才能够准确的识别版本约束。更多相关信息请查看 [别名](../articles/aliases.md)。 #### 使用私有资源库 @@ -456,7 +456,7 @@ Satis 是一个静态的 `composer` 资源库生成器。它像是一个超轻 你给它一个包含 `composer.json` 的存储库,定义好 VCS 和 资源库。它会获取所有你列出的包,并打印 `packages.json` 文件,作为 `composer` 类型的资源库。 -更多详细信息请查看 [github.com/composer/satis](https://github.com/composer/satis) 和 [Satis article](articles/handling-private-packages-with-satis.md)。 +更多详细信息请查看 [github.com/composer/satis](https://github.com/composer/satis) 和 [Satis article](../articles/handling-private-packages-with-satis.md)。 ### Artifact diff --git a/faq/_index.md b/faq/_index.md new file mode 100644 index 0000000..5732ca7 --- /dev/null +++ b/faq/_index.md @@ -0,0 +1,6 @@ +# FAQ + +- [如何为我的框架自定义一个资源包安装目录](/faq/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md) +- [我应该提交 vendor 目录中的依赖包吗](/faq/should-i-commit-the-dependencies-in-my-vendor-directory.md) +- [为什么说“比较符”和“通配符”相结合的版本约束是坏主意](/faq/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md) +- [为什么 Composer 不递归加载储存库](/faq/why-can't-composer-load-repositories-recursively.md) diff --git a/cn-introduction/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md b/faq/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md similarity index 100% rename from cn-introduction/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md rename to faq/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md diff --git a/cn-introduction/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md b/faq/should-i-commit-the-dependencies-in-my-vendor-directory.md similarity index 92% rename from cn-introduction/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md rename to faq/should-i-commit-the-dependencies-in-my-vendor-directory.md index 43534aa..cdbf956 100644 --- a/cn-introduction/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md +++ b/faq/should-i-commit-the-dependencies-in-my-vendor-directory.md @@ -13,6 +13,6 @@ 如果你真的觉得你必须这样做,你有几个选择: 1. 限制自己安装标记版本(无 dev 版本),这样你只会得到 zip 压缩的安装,并避免 git“子模块”出现的问题。 -2. 使用 --prefer-dist 或在 [config](../04-schema.md#config) 选项中设置 `preferred-install` 为 `dist`。 +2. 使用 --prefer-dist 或在 [config](../cn-introduction/04-schema.md#config) 选项中设置 `preferred-install` 为 `dist`。 3. 在每一个依赖安装后删除其下的 `.git` 文件夹,然后你就可以添加它们到你的 git repo 中。你可以运行 `rm -rf vendor/**/.git` 命令快捷的操作,但这意味着你在运行 composer update 命令前需要先删除磁盘中的依赖文件。 4. 新增一个 .gitignore 规则(`vendor/.git`)来忽略 vendor 下所有 `.git` 目录。这种方法不需要你在运行 composer update 命令前删除你磁盘中的依赖文件。 diff --git a/cn-introduction/faqs/why-are-unbound-version-constraints-a-bad-idea.md b/faq/why-are-unbound-version-constraints-a-bad-idea.md similarity index 100% rename from cn-introduction/faqs/why-are-unbound-version-constraints-a-bad-idea.md rename to faq/why-are-unbound-version-constraints-a-bad-idea.md diff --git a/cn-introduction/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md b/faq/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md similarity index 83% rename from cn-introduction/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md rename to faq/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md index 749fa11..720a027 100644 --- a/cn-introduction/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md +++ b/faq/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md @@ -7,6 +7,7 @@ - `>=2` 表示资源包应该是 2.0.0 或以上版本。 - `2.*` 表示资源包版本应该介于 2.0.0 (含)和 3.0.0(不含)之间。 -正如你所看到的,要同时满足这两个规则包版本必须 >=2.0.0,但它是无法判断的,因为当你这么写的时候,你究竟是想要包含 3.0.0 版本还是不包含?它应该进行匹配吗?因为你定义了 `>=2`,但同时你又限制它为 `2.*`。 +正如你所看到的,要同时满足这两个规则包版本必须 >=2.0.0,但它是无法判断的,因为当你这么写的时候,你究竟是想要包含 3.0.0 +版本还是不包含?它应该进行匹配吗?因为你定义了 `>=2`,但同时你又限制它为 `2.*`。 出于这个原因,Composer 将抛出一个错误,并告诉你这是无效的。想要确切的表达你意思,最简单的方法就是仅使用“比较符”和“通配符”其中的一种来定义约束。 \ No newline at end of file diff --git a/cn-introduction/faqs/why-can't-composer-load-repositories-recursively.md b/faq/why-can't-composer-load-repositories-recursively.md similarity index 54% rename from cn-introduction/faqs/why-can't-composer-load-repositories-recursively.md rename to faq/why-can't-composer-load-repositories-recursively.md index 781e6e9..793bf82 100644 --- a/cn-introduction/faqs/why-can't-composer-load-repositories-recursively.md +++ b/faq/why-can't-composer-load-repositories-recursively.md @@ -1,13 +1,21 @@ # 为什么 Composer 不递归加载储存库? -当你使用自定义库时,你可能会碰到问题,因为 Composer 不会递归加载你要求的储存库,所以你必须修改这些储存库中所有的 `composer.json` 文件。 +当你使用自定义库时,你可能会碰到问题,因为 Composer +不会递归加载你要求的储存库,所以你必须修改这些储存库中所有的 `composer.json` 文件。 -在详细说明为什么是这样之前,你需要明白:使用自定义 VCS & 包储存库去尝试某些事情,或者使用你 fork 的一个分支,直到你的 pull request 被合并,等等。你不应该使用它们来跟踪你的私人资源包,关于这点你应该看看 [setting up Satis](../articles/handling-private-packages-with-satis.md) 来为你的公司甚至自己处理私人资源包。 +在详细说明为什么是这样之前,你需要明白:使用自定义 VCS & 包储存库去尝试某些事情,或者使用你 fork 的一个分支,直到你的 pull +request +被合并,等等。你不应该使用它们来跟踪你的私人资源包,关于这点你应该看看 [setting up Satis](../articles/handling-private-packages-with-satis.md) +来为你的公司甚至自己处理私人资源包。 这里有三个途径可以使依赖解析器使用你自定义的储存库: - 读取根包的存储库,从定义的存储库得到所有的软件包,解析依赖需求。这是目前的状态,它工作得很好,除了有“无法递归的加载储存库”这个限制。 -- 读取根包的存储库,同时从定义的 repos 初始化资源包,递归的初始化,根据所有依赖包中定义的 repos,以及这些依赖包所依赖的其它包中定义的 repos,等等,然后再解析依赖需求。这可能可以工作,但会严重影响初始化的速度,因为每读取一个 VCS repos 都需要几秒钟。它可能最终执行失败,因为一个包的不同版本,可能来自一个包资源库中一个相同的包,但来至不同的 dist/source 。这样有太多的可能会出错。 +- 读取根包的存储库,同时从定义的 repos 初始化资源包,递归的初始化,根据所有依赖包中定义的 repos,以及这些依赖包所依赖的其它包中定义的 + repos,等等,然后再解析依赖需求。这可能可以工作,但会严重影响初始化的速度,因为每读取一个 VCS repos + 都需要几秒钟。它可能最终执行失败,因为一个包的不同版本,可能来自一个包资源库中一个相同的包,但来至不同的 dist/source + 。这样有太多的可能会出错。 -- 读取根包的存储库,然后读取第一级依赖,接着读取这些依赖包所依赖的其它包,等等,然后再解析依赖需求。这样听起来更有效率,但仍然存在第二种解决方案中的问题。因为加载依赖的储存库并不像听起来那么容易。你需要加载所有可能匹配的依赖包的 repos,而这些包的定义又可能是互相冲突的。 +- 读取根包的存储库,然后读取第一级依赖,接着读取这些依赖包所依赖的其它包,等等,然后再解析依赖需求。这样听起来更有效率,但仍然存在第二种解决方案中的问题。因为加载依赖的储存库并不像听起来那么容易。你需要加载所有可能匹配的依赖包的 + repos,而这些包的定义又可能是互相冲突的。