如何知道我拥有哪个版本的 Symfony? [英] How to know which version of Symfony I have?
问题描述
我知道我已经下载了一个 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
有什么想法吗?
推荐答案
Run app/console --version
(for 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
创建了一个 SymfonyBundleFrameworkBundleConsoleApplication
的实例.在这个类构造函数中,它使用 SymfonyComponentHttpKernelKernel::VERSION
来初始化它的父构造函数.
Just in case you are wondering, console
creates an instance of SymfonyBundleFrameworkBundleConsoleApplication
. In this class constructor, it uses SymfonyComponentHttpKernelKernel::VERSION
to initialize its parent constructor.
这篇关于如何知道我拥有哪个版本的 Symfony?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!