Doctrinebundle: User Deprecated: YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.

Created on 26 Nov 2019  路  15Comments  路  Source: doctrine/DoctrineBundle

composer show doctrine/doctrine-bundle
versions : * 2.0.0

composer show doctrine/orm
versions : * v2.7.0

There are still references to the YamlDriver and SimplifiedYamlDriver within the code of doctrine-bundle which result in log messages about the deprecation when installed beside doctrine/orm v2.7.0.

https://github.com/doctrine/DoctrineBundle/search?q=SimplifiedYamlDriver+OR+YamlDriver&unscoped_q=SimplifiedYamlDriver+OR+YamlDriver

Shouldn't those references be removed?

Stale Waiting feedback Unconfirmed

Most helpful comment

YAML has been deprecated in ORM 2.7 (and already been removed in ORM 3.0) for various reasons, one of them being that we need to maintain its metadata driver separately from XML and annotations, causing additional workload. This is certainly true, but the deprecation has not yet been reflected in this bundle for lack of an alternative (at the moment, the only alternative is users switching away from YAML). We're working on a suitable alternative that hopefully solves this problem for any future configuration formats as well.

All 15 comments

YAML has been deprecated in ORM 2.7 (and already been removed in ORM 3.0) for various reasons, one of them being that we need to maintain its metadata driver separately from XML and annotations, causing additional workload. This is certainly true, but the deprecation has not yet been reflected in this bundle for lack of an alternative (at the moment, the only alternative is users switching away from YAML). We're working on a suitable alternative that hopefully solves this problem for any future configuration formats as well.

Are these referenced to YamlDriver and SimplifiedYamlDriver used even when there is no YAML mapping file registered ?

Right, we need to clear this up. @calbrecht in what way are you getting these deprecation messages? Is it output from some SA analyzer, phpunit output, PHP error log? Are you using YAML mapping?

@ostrolucky output is from PHP error log. We are not using YAML mapping.

Happy to assist in debugging, but need instructions here.

Is it when running phpunit, some bin/console command, or some page in web browser?

It occurs in the logs at every request served.

I think this happens because of the deprecation handling in symfony and probably the fix would be to release a new major version of doctrine-bundle with the YamlDriver removed from Resources/config/orm.xml and requiring doctrine/orm 2.7+?

probably the fix would be to release a new major version of doctrine-bundle with the YamlDriver removed

No. We will not be removing the YAML driver from the Symfony integration.

Could it be a solution to lazily register the driver so that it will only be used when there is actually any mapping for said format?

I've updated doctrine/orm and doctrine/doctrine-bundle in symfony-demo and am not getting Yaml deprecations. We will appreciate reproducer.

This issue is still waiting on feedback. Please provide the information requested above to allow us to continue working on this ticket.
This issue will be closed after 7 days. You can still provide us with the necessary information to continue working on this issue, and we will reopen the ticket for you. Thanks!

I'm a little late to the game but let me make sure i've got this straight. you have deprecated and removed yaml, a very well used and highly respected format... for xml, a format that needs to die; and annotations, a format that shouldn't exist?

Who's bright idea was that? This is the only thing that's keeping me from using symfony again - symfony without doctrine is trash, and doctrine without yaml is worthless.

I don't like annotation either (as long as they aren't natively supported by PHP).

But about XML I disagree.
Sure, XML makes you feel like you want to die; sometimes. But it's a very solid, versatile and portable language.
It's just more verbose; and requires you to understand more concepts in order to use it properly.

YAML is easier, faster to use, more readable, but I never liked to use it except for very simple files.

XML is near 50 years old, it's time it be put out to pasture.

@jblac please voice your concern in the ORM issue tracker (https://github.com/doctrine/orm), but remember that this has been discussed back and forth without any sensible outcome. DoctrineBundle is merely mirroring any change in ORM.

I'm locking this issue as there's nothing the bundle maintainers can do here (and please rest assured that we've tried).

Was this page helpful?
0 / 5 - 0 ratings