加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

为什么SymfonyRequirements.php被排除在.gitignore之外?

发布时间:2020-12-13 21:55:19 所属栏目:PHP教程 来源:网络整理
导读:如果我理解正确,SymfonyRequirements.php文件(它位于/ app或/ var,取决于Symfony版本)由Composer处理.因此,我认为任何版本控制系统都不应该跟踪它.但是,我看到它被排除在 Symfony Standard Edition’s .gitignore file之外: /var/*[...]!var/SymfonyRequire
如果我理解正确,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应该或不应该跟踪它?

解决方法

Symfony Check CLI Script使用此文件来检查配置和配置的最低要求.运行Symfony应用程序.这是 Common Post-Deployment Task.

它检查当前的PHP版本/配置(php.ini设置)和所需的PHP扩展.例如,它检查当前设置date.timezone.

@stof试图说的是,即使在使用composer install安装依赖项之前,您也应该能够运行检查.它甚至检查依赖项安装本身:vendor / composer目录的checks for existence.

它给你一个好的&充分了解Symfony App是否具有基于当前PHP配置运行所需的内容.

请注意,通过将此文件添加到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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读