如何找出我正在运行的Doctrine版本?

slu*_*rew 18 doctrine codeigniter doctrine-1.2 doctrine-orm

CodeIgniter已经使用了一段时间,我不记得我是安装了v2还是只是从另一个项目中复制了文件.

有任何想法吗?

Chu*_*ose 40

查看文件lib/Doctrine/ORM/Version.php,其中有一个常量显示版本.它也可以从正在运行的应用程序访问,但这更容易.


Fra*_*ula 31

如果您使用composer来处理项目的依赖项,那么您应该尝试:

php composer.phar show --installed
Run Code Online (Sandbox Code Playgroud)

要么

php composer.phar show -i | grep doctrine
Run Code Online (Sandbox Code Playgroud)

输出将是这样的:

doctrine/annotations                     v1.1.2             Docblock Annotations Parser
doctrine/cache                           v1.3.0             Caching library offering an object-oriented API for many cache backends
doctrine/collections                     v1.2               Collections Abstraction library
doctrine/common                          v2.4.1             Common Library for Doctrine projects
doctrine/data-fixtures                   v1.0.0             Data Fixtures for all Doctrine Object Managers
doctrine/dbal                            2.3.4              Database Abstraction Layer
doctrine/doctrine-bundle                 v1.2.0             Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle        v2.2.0             Symfony DoctrineFixturesBundle
doctrine/inflector                       v1.0               Common String Manipulations with regard to casing and singular/plural rules.
doctrine/lexer                           v1.0               Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm                             2.3.5              Object-Relational-Mapper for PHP
Run Code Online (Sandbox Code Playgroud)


fir*_*dev 6

core.php:

class Doctrine_Core
{
    /**
     * VERSION
     */
    const VERSION                   = '1.2.4';

...
Run Code Online (Sandbox Code Playgroud)


Jla*_*ano 5

在我的symfony2symfony3项目中,找到正确的Version.php文件的第39行的路径是:

供应商/原则/orm/lib/Doctrine/ORM/Version.php


小智 5

对于 Windows 用户:

在你的 symfony2 项目中:

\vendor\doctrine\orm\lib\Doctrine\ORM\Version.php
Run Code Online (Sandbox Code Playgroud)

寻找类似的东西:

/**
 * Current Doctrine Version
 */
const VERSION = '2.4.6';
Run Code Online (Sandbox Code Playgroud)