为什么 SymfonyRequirements.php 被排除在 .gitignore 之外?
Why is SymfonyRequirements.php excluded from .gitignore?
如果我理解正确,SymfonyRequirements.php
文件(位于 /app
或 /var
下,具体取决于 Symfony 版本)由 Composer 处理。因此我认为它不应该被任何版本控制系统跟踪。但是,我看到它被排除在 Symfony Standard Edition's .gitignore file:
之外
/var/*
[...]
!var/SymfonyRequirements.php
编辑
Symfony 核心开发者 @Stof 在 a Github issue 中说:
given that one of the checks is whether you installed vendors, it must
be there before installing them (even though we have an automatic
update of the requirements so that you check the uptodate ones next
time).
这个我不是很清楚。任何人都可以提供有关此文件的更多详细信息并解释为什么它应该或不应该被 VCS 跟踪吗?
The files is used in the check CLI tool that use this files for control the minimal Requirements for Running Symfony. You can find more info in the doc.
Usually is take into account in a version control system, as you can see in the symfony-standard distribution project on github:
https://github.com/symfony/symfony-standard
(of course you can add the files in your custom .gitignore files)
为了更精确,此文件用于 symfony 3 的命令 php bin/symfony_requirements
和旧版本的 php app/check.php
,检查您的 php/symfony 要求。
看到这个问题 and the documentation。
此文件由 Symfony Check CLI Script to check for minimum requirements of configuring & running a Symfony App. It's a Common Post-Deployment Task 使用。
它检查当前 PHP Version/Configurations(php.ini
设置)和所需的 PHP 扩展。例如,它检查 date.timezone.
的当前设置
@stof 想说的是你应该能够 运行 检查甚至在使用 composer install
安装依赖项之前。它甚至会自行检查依赖项安装:vendor/composer
目录的 checks for existence。
根据当前 PHP 配置,它可以让您充分了解 Symfony 应用程序是否具有它需要的功能 运行。
请注意,通过将此文件添加到 VCS,您应该知道稍后使用 composer update
更新依赖项后此文件可能会发生变化。所以你也应该记得提交这个文件!.
请注意,这些检查还提供了一些要设置的建议(不是要求)。例如检查 this recommendation 出:
When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
其他一些使用 Symfony 的项目也通过扩展此文件来实现自己的检查,例如 checkout Oro Platforms Requirements Check.
如果我理解正确,SymfonyRequirements.php
文件(位于 /app
或 /var
下,具体取决于 Symfony 版本)由 Composer 处理。因此我认为它不应该被任何版本控制系统跟踪。但是,我看到它被排除在 Symfony Standard Edition's .gitignore file:
/var/*
[...]
!var/SymfonyRequirements.php
编辑
Symfony 核心开发者 @Stof 在 a Github issue 中说:
given that one of the checks is whether you installed vendors, it must be there before installing them (even though we have an automatic update of the requirements so that you check the uptodate ones next time).
这个我不是很清楚。任何人都可以提供有关此文件的更多详细信息并解释为什么它应该或不应该被 VCS 跟踪吗?
The files is used in the check CLI tool that use this files for control the minimal Requirements for Running Symfony. You can find more info in the doc.
Usually is take into account in a version control system, as you can see in the symfony-standard distribution project on github:
https://github.com/symfony/symfony-standard
(of course you can add the files in your custom .gitignore files)
为了更精确,此文件用于 symfony 3 的命令 php bin/symfony_requirements
和旧版本的 php app/check.php
,检查您的 php/symfony 要求。
看到这个问题
此文件由 Symfony Check CLI Script to check for minimum requirements of configuring & running a Symfony App. It's a Common Post-Deployment Task 使用。
它检查当前 PHP Version/Configurations(php.ini
设置)和所需的 PHP 扩展。例如,它检查 date.timezone.
@stof 想说的是你应该能够 运行 检查甚至在使用 composer install
安装依赖项之前。它甚至会自行检查依赖项安装:vendor/composer
目录的 checks for existence。
根据当前 PHP 配置,它可以让您充分了解 Symfony 应用程序是否具有它需要的功能 运行。
请注意,通过将此文件添加到 VCS,您应该知道稍后使用 composer update
更新依赖项后此文件可能会发生变化。所以你也应该记得提交这个文件!.
请注意,这些检查还提供了一些要设置的建议(不是要求)。例如检查 this recommendation 出:
When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
其他一些使用 Symfony 的项目也通过扩展此文件来实现自己的检查,例如 checkout Oro Platforms Requirements Check.