Migrations 2.0 Stable Released

Posted on January 9, 2019 by Jonathan H. Wage

Today we are very excited to announce the stable release of Doctrine Migrations 2.0. Almost 10 years ago on Mar 23, 2010, the first commit of the 1.0 codebase was created. The history of the Doctrine Migrations project actually even goes back further to the days of Doctrine1 ORM but this was before the days of GitHub, Composer, etc and I think some of that history has been lost. It is amazing to look back over the last decade at how much the PHP eco-system has changed. It makes us appreciate all the great tools we have, even with all their flaws.

What is in 2.0?

The 2.0 release should be a relatively easy upgrade for most people. The primary goal of the 2.0 release was to modernize the codebase according to Doctrine Coding Standards, PHPStan and all of the other standardized Doctrine project infrastructure that has evolved over the last few years. This will ensure the project is alive and relevant for another decade.

In addition to upgrading the infrastructure of the project, it came with a few new nice features:

You can view the full changelog in the release on GitHub.

This release contains 36 resolved issues with 71 pull requests coming from 18 different contributors. Thanks to the following people for their help with this release:

Phasing out Doctrine Common & release of DBAL 2.8 and ORM 2.6.2

Posted on July 12, 2018 by Michael Moravec

Common 2.9 and phasing out the package

As another step in the ongoing effort to eliminate doctrine/common, there are now three new separate Doctrine packages:

This release introduces the following deprecations:

  • Doctrine\Common\Proxy component is deprecated, use ocramius/proxy-manager instead;
  • Doctrine\Common\Util\Debug is deprecated, use symfony/var-dumper instead;
  • Doctrine\Common\Lexer is deprecated, use Doctrine\Common\Lexer\AbstractLexer from doctrine/lexer or migrate to hoa/compiler instead;
  • Doctrine\Common\Util\Inflector is deprecated, use Doctrine\Common\Inflector\Inflector from doctrine/inflector instead;
  • Doctrine\Common\Util\ClassUtils is deprecated without replacement;
  • Doctrine\Common\Version is deprecated, refrain from checking Common version at runtime;
  • Doctrine\Common\CommonException is deprecated without replacement.

In addition to that, there will be no doctrine/common 3.0 and the package will be gradually phased out.

Version 2.x will be maintained at least until ORM 3.0 is released, ensuring compatibility with the latest PHP and providing bugfixes, but it will no longer ship any new features.

For complete release notes, visit GitHub.

DBAL 2.8.0

DBAL 2.8.0 is a minor release of Doctrine DBAL that aggregates over 30 fixes and improvements developed over the last 3 months.

The dependency on doctrine/common is removed. DBAL now depends on doctrine/cache and doctrine/event-manager instead.

For complete release notes, visit GitHub.

ORM 2.6.2

ORM 2.6.2 comes as a regular bugfix release.

It no longer uses the long ago deprecated Lexer and Inflector from doctrine/common.

For complete release notes, visit GitHub.

New Website

Posted on April 6, 2018 by Jonathan H. Wage

In 2007 Doctrine got its first official website at phpdoctrine.org. Before that, the website was an instance of Trac which also served as our documentation, issue tracker and project management tool.

The new website design was created by Phu Son Nguyen who worked at Yahoo! at the time. It was a huge step forward for the Doctrine Project and it gave us 10 solid years!

Fast-forward and today we are happy to be launching a new foundation for our website and documentation. In addition to the new look, here are some new features:

  • GitHub Edit links on all documentation pages to make it easy to contribute fixes when you come across something that could be improved.
  • Automated deploys with GitHub Pages. Simply create a pull request and it will be deployed to https://staging.doctrine-project.org. Merges to master automatically deploy to https://www.doctrine-project.org.
  • Search powered by Algolia.
  • Mobile friendly.
  • Documentation supports multiple versions.
  • Documentation user experience improvements.

We hope that this helps improve the experience and make it easier to contribute. The code for the site is open source and can be found here. If you want to contribute to the documentation for a project, you can find the docs in a folder named /docs in the root of the project repository. Here is the ORM for example.

If you discover any issues, please report them on the GitHub Issue tracker for the project.

Doctrine ORM 2.6 and Next (3.0)

Posted on December 21, 2017 by Mike Simonson

We are happy to announce the immediate availability of Doctrine ORM 2.6.0.

ORM 2.6.0

This release contains almost 3 years of active development and it provides several improvements and fixes, including:

  • Better commit order calculation
  • More stable second level cache
  • Strict testing and quality control
  • PHP 7.1+ requirement



This release marks the feature freeze of the 2.x version.

If you need to improve please work on the develop branch that will become the 3.0 branch in the coming days. The changes are already too numerous to easily rebase a feature from the 2.x branch to the develop one.

Doctrine MongoDB ODM 1.2.0 and 1.1.7 Released

Posted on October 24, 2017 by Andreas Braun

We are happy to announce the immediate availability of Doctrine MongoDB ODM 1.2.0 and 1.1.7.

MongoDB ODM 1.1.7

Notable fixes may be found in the changelog. A full list of issues and pull requests included in this release may be found in the 1.1.7 milestone.

What is new in 1.2.0?

Doctrine MongoDB ODM 1.2.0 introduces the following new features:

  • The readOnly mapping option allows you to map immutable documents.
  • With slaveOkay being deprecated, you can now specify a readPreference for your documents. This readPreference will automatically be applied to all queries for those mapped documents.
  • With dbRef only offering limited support in aggregation pipeline queries, there's a new reference storage strategy called ref that stores references as objects (without "\$"-prefixed field names), allowing you to use it with discriminators and aggregation pipeline queries.
  • When mapping inverse references, you may now specify fields that will be primed when the reference is resolved. This saves you from writing a dedicated repository method for the sole purpose of priming references.
  • The odm:schema:validate command validates the document mapping to help you spot mistakes.
  • A new builder for aggregation pipeline queries, including support for marshalling results into read-only documents.
  • Query result documents that can be used to hydrate results from an aggregation pipeline query. These documents cannot be written back to the database.

Upgrading to 1.2.0

The new version requires PHP 5.6. Running on PHP 7+ requires the use of a polyfill for the legacy driver, e.g. mongo-php-adapter. When running on PHP 5.6, MongoDB ODM requires version 1.6.7 or newer of the legacy MongoDB driver.

Several features have been deprecated in this release and will be dropped in the 2.0 release. To see this, please view the UPGRADE document.


You can install the new version of MongoDB ODM by using Composer and the following composer.json contents:

    "require": {
        "doctrine/mongodb-odm": "^1.2.0"

Stability and upcoming releases

As of today, Doctrine MongoDB ODM 1.2.0 is the stable distribution. There is no release schedule for an upcoming version yet.

1.1.7 is the last release of the 1.1.x development line and will no longer receive bug fixes. Instead, we will focus on developing MongoDB ODM 2.0 with native support for the new MongoDB driver. This release will require at least PHP 7.1 and contain several BC breaking changes. To ease the migration process, we will release a 1.3.0 which will be backwards compatible to the 1.2.x line and only deprecate features to be removed in 2.0. The 1.x line of MongoDB ODM will not receive any new features.

PHP 7.1 requirement for Doctrine packages

Posted on July 25, 2017 by Andreas Braun

A few days ago, the Doctrine team released new versions of many packages, dropping support for PHP 5.6 and 7.0, as well as HHVM. The affected packages are:

  • doctrine/common 2.8.0
  • doctrine/dbal 2.6.0
  • doctrine/collections 1.5.0
  • doctrine/inflector 1.2.0
  • doctrine/cache 1.7.0
  • doctrine/instantiator 1.1.0
  • doctrine/annotations 1.5.0

Since many people are encountering issues with these updates, here are a few suggestions to ensure your code continues working as usual.

Composer version constraints

Chances are your version constraints in composer.json look something like this:

    "require": {
        "doctrine/orm": "^2.5"

The ^2.5 constraint resolves to: >= 2.5.0 && <= 2.999999.999999. This is intended: our projects all follow Semantic Versioning, so you can safely install a new minor version without having to fear BC breaks.

When determining what version to install, composer employs a SAT solver to make sure all dependencies are fulfilled. In our example above, the SAT solver finds a version newer than 2.5 that satisfies all requirements.

Making sure you get a compatible version

When you run composer update the next time, you'll automatically receive updates for the packages mentioned above, provided that you are running on PHP 7.1. If you are running an older PHP version, composer will not install a version that requires PHP 7.1, since its requirements are not fulfilled.

A common problem is people running a newer PHP version on their developer machines than on their production servers. In this case, running composer update on a developer machine (with PHP 7.1) might happily pull in an update that simply won't work when deployed on a production machine running PHP 5.6.

To make sure this doesn't happen to you, there are two choices:

  • run composer update on a machine with the same PHP version that you use in production
  • use the platform.config config setting in composer.json to override your local PHP version.

Why dropping PHP support in a minor version is not a BC break

One question we frequently hear is, "isn't dropping support for a PHP version a BC break"? In a nutshell, no. A BC break happens when there is an incompatible change that your package manager can't handle. For example, changing a method signature in a minor version is a no-go, since the composer version constraints mentioned above assume any minor upgrade can safely be used.

However, when we drop support for an older version of PHP, composer will not consider the new version if the PHP version requirement is no longer fulfilled. Thus, you won't end up with a fatal error due to a wrong method signature, you just won't get the new version.

Doctrine MongoDB 1.4.0

Posted on November 22, 2016 by Andreas Braun

We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.4.0.

Passing context options to the driver

With this release it's possible to pass driver options to the connection class, which will then be passed on to the MongoDB driver. For example, to pass a stream context with SSL context options, you could use the following code snippet:

$context = stream_context_create([
    'ssl' => [
        'allow_self_signed' => false,
$connection = new \Doctrine\MongoDB\Connection(null, [], null, null, ['context' => $context]);

Passing multiple expressions to logical operators

The addAnd, addNor and addOr methods in the query and aggregation builders now take multiple expression objects. Instead of having to call the method repeatedly, you may call it once with multiple arguments:

// Before

// After
$builder->addAnd($someExpression, $otherExpression);


The update and multiple methods in the query have been deprecated in favor of updateOne and updateMany. These deprecations help people using ODM prepare for the next version of ODM which will utilize the new MongoDB library API.

Bug fixes in this release

Notable fixes may be found in the changelog. A full list of issues and pull requests included in this release may be found in the 1.4.0 milestone.

PHP version support

With this release, we have dropped support for PHP 5.5. Users using PHP 5.5 or older are encouraged to upgrade to a newer PHP version. If you are using PHP 7.0 or 7.1, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.

Future releases

This release is the last planned minor release of the MongoDB Abstraction Layer, with only bugfixes being done in maintenance releases. The library will not be rewritten to support the new MongoDB driver. Users are encouraged to use the new MongoDB library. Doctrine MongoDB ODM will be adapted to support the new driver and the MongoDB library.


You can install the latest version using the following composer.json definitions:

    "require": {
        "doctrine/mongodb": "^1.4.0"

Doctrine MongoDB ODM 1.1.2 and 1.0.8 released

Posted on October 7, 2016 by Andreas Braun

We are happy to announce the immediate availability of Doctrine MongoDB ODM 1.1.2 and 1.0.8.

MongoDB ODM 1.0.8

  • calling dropCollections() in the SchemaManager did not drop GridFS collections. #1468
  • calling clear() on an uninitialized collection with orphanRemoval enabled failed to remove orphaned documents. #1500 - Documents with identifiers evaluating to false (e.g. empty string or 0) could not be reference using createDBRef() in DocumentManager. #1503

MongoDB ODM 1.1.2

  • This release contains the bugfixes outlined for ODM 1.0.8 above

  • Querying for referenced objects in findBy() or findOneBy() did not work properly due to incorrect preparation of the DBRef objects. #1481


You can install the latest version using the following composer.json definitions:

    "require": {
        "doctrine/mongodb-odm": "^1.1.2"

Support for Doctrine ODM 1.0.x

As outlined previously, support for MongoDB ODM 1.0.x will end on December 9th, 2016. If you have not upgraded to version 1.1 yet, please do so to receive future bug fixes.

Doctrine ORM 2.5.5 Released

Posted on September 10, 2016 by Marco Pivetta

We are happy to announce the immediate availability of Doctrine ORM 2.5.5.

Following issues were fixed:

  • Embeddable classes are now allowed in inheritance trees #4097
  • Removed some object hash collisions caused by entity merging #1465
  • Allowed usage of mathematical operators in DQL HAVING clauses #5598
  • Fixed cloning of proxies with private properties at multiple inheritance levels #5755
  • Entity insertions are correctly cleared when a specific entity is to be cleared #5849
  • Corrected hydration of fetch-joins that use composite keys #5762
  • Metadata exporters now only export the owning side metadata in a one-to-one relation #5858
  • Corrected hydration of JTI entities when NULL is retrieved for a simple_array or json_array field #5989
  • Correctly expire L2 cache query caches, based on entity region cache timestamp #6001


You can install the ORM component using Composer:

composer require doctrine/orm:^2.5.5

Please report any issues you may have with the update on the issue tracker.

Doctrine DBAL 2.5.5 Released

Posted on September 9, 2016 by Marco Pivetta

We are happy to announce the immediate availability of Doctrine DBAL 2.5.5.

This release contains a huge amount of fixes, specifically:

  • Parsing of SQL strings containing single quotes #842
  • Listing foreign key names when no DB name is used (use current DB instead) #856
  • Verifying if table names correspond on dropped foreign keys #861
  • Quoting identifiers in DROP DDL statements #862
  • Removing leading slash from database/schema names when using DSNs #863
  • Stopped using template1 as default database in Postgres #2279
  • Allowing "path" instead of "dbname" in SQLite connections #2267
  • Correcting DB2 boolean columns schema introspection #2277
  • Correcting OCI8 parameter binding, which was broken by upgrading to PHP 7.0 #2434
  • Quoting reserved table names when using TRUNCATE #2270
  • Fixing of DSN parsing when no schema is in the path #2287
  • Correcting query builder, which was adding a FROM clause even with no arguments for it #2292
  • Correcting altering primary key with AUTO_INCREMENT on MySQL (requires dropping/re-adding PK) #2303
  • Moving DB2 pagination (query modification) offset/limit count result to the end of the results #2310
  • Handling Throwable exceptions thrown in Connection#transactional() #2390
  • Correcting logging of parameters passed to a statement via bindParam() #2440
  • Allowing installation of symfony/console:^3.0 #2484
  • Correcing MySQLi statements, which were returning null instead of false on no results #2497


You can install the DBAL component using Composer:

composer require doctrine/dbal:^2.5.5

Please report any issues you may have with the update on the issue tracker.

View Blog Archive