如何知道我有哪个版本的Symfony? [英] How to know which version of Symfony I have?

查看:787
本文介绍了如何知道我有哪个版本的Symfony?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我已经下载了一个Symfony2项目并开始使用,但是我已经多次更新了供应商,我想知道我拥有的symfony版本

I know that I have downloaded a Symfony2 project and started with but I have updated my vendor several times and I want to know which version of symfony I have

有什么主意吗?

推荐答案

运行app/console --version(对于Symfony3:bin/console --version),它应该给您一个很好的主意.在我的一个随机项目中,输出为:

Run app/console --version (for Symfony3: bin/console --version), it should give you a pretty good idea. On a random project of mine, the output is:

Symfony version 2.2.0-DEV - app/dev/debug

如果无法访问控制台,请尝试阅读symfony/src/Symfony/Component/HttpKernel/Kernel.php,其中版本为

If you can't access the console, try reading symfony/src/Symfony/Component/HttpKernel/Kernel.php, where the version is hardcoded, for instance:

const VERSION         = '2.2.0';

以防万一,console创建一个Symfony\Bundle\FrameworkBundle\Console\Application的实例.在此类的构造函数中,它使用Symfony\Component\HttpKernel\Kernel::VERSION初始化其父构造函数.

Just in case you are wondering, console creates an instance of Symfony\Bundle\FrameworkBundle\Console\Application. In this class constructor, it uses Symfony\Component\HttpKernel\Kernel::VERSION to initialize its parent constructor.

这篇关于如何知道我有哪个版本的Symfony?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆