我如何知道我正在运行哪个版本的 Doctrine?

发布于 2024-09-24 04:43:53 字数 81 浏览 7 评论 0原文

已经将它与 CodeIgniter 一起使用了一段时间,我不记得我是否安装了 v2 或者只是从另一个项目复制了文件。

有什么想法吗?

Have been using it for a while with CodeIgniter and I can't remember if I installed v2 or just copied the files from another project.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

老子叫无熙 2024-10-01 04:43:53

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

Check out the file vendor/doctrine/orm/lib/Doctrine/ORM/Version.php, there is a constant in there that shows the version. It's also accessible from a running app but this is easier.

菩提树下叶撕阳。 2024-10-01 04:43:53

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

php composer.phar show --installed

OR

php composer.phar show -i | grep doctrine

输出将类似于:

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

If you are using the composer to handle dependencies on your project, then you should try with:

php composer.phar show --installed

OR

php composer.phar show -i | grep doctrine

And the output will be something like:

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
嘴硬脾气大 2024-10-01 04:43:53

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

供应商/doctrine/orm/lib/Doctrine/ORM/Version.php

Within my symfony2 and symfony3 project, the path to find the correct Version.php file, line 39, was:

Vendor/doctrine/orm/lib/Doctrine/ORM/Version.php

流绪微梦 2024-10-01 04:43:53

core.php:

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

...

core.php:

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

...
糖粟与秋泊 2024-10-01 04:43:53

对于 Windows 用户:

在您的 symfony2 项目中:

\vendor\doctrine\orm\lib\Doctrine\ORM\Version.php

查找类似以下内容:

/**
 * Current Doctrine Version
 */
const VERSION = '2.4.6';

For Windows users:

Within your symfony2 project:

\vendor\doctrine\orm\lib\Doctrine\ORM\Version.php

look for something like:

/**
 * Current Doctrine Version
 */
const VERSION = '2.4.6';
画骨成沙 2024-10-01 04:43:53

如果您使用 PATH 作为其可执行文件安装了 Composer,则可能会收到 Composer.phar 不存在的错误。

这对我有用:

%composer show --installed | grep "doctrine/orm"

您应该得到显示版本号的输出:

You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
doctrine/orm                             v2.5.14 Object-Relational-Mapper for PHP

请注意,您不需要 | grep 部分;如果删除它,您将在项目中看到 Composer 中安装的所有内容。您可以改为使用 | grepdoctrine 查看所有与 Doctrine 相关的已安装软件包版本。

If you have composer installed using your PATH for its executable, you may get an error that composer.phar doesn't exist.

This works for me:

% composer show --installed | grep "doctrine/orm"

You should get output showing the version number:

You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
doctrine/orm                             v2.5.14 Object-Relational-Mapper for PHP

Note that you don't need the | grep part; if you remove that, you'll see all installed things from composer in the project. You can instead use | grep doctrine to see all Doctrine-related installed package versions.

故事还在继续 2024-10-01 04:43:53

对于 Doctrine 版本 1.* 打开文件 /doctrine/Doctrine/Core.php

应该在开头看到版本号。

For Doctrine version 1.* open file /doctrine/Doctrine/Core.php

Should see version number at the begging.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文