Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Convert config from XML to PHP#1914

Merged
ostrolucky merged 1 commit into
doctrine:2.16.xfrom
nicolas-grekas:php-config
Aug 29, 2025
Merged

Convert config from XML to PHP#1914
ostrolucky merged 1 commit into
doctrine:2.16.xfrom
nicolas-grekas:php-config

Conversation

@nicolas-grekas
Copy link
Copy Markdown
Member

PHP is nicer than XML and symfony/symfony#60568 might make this required at some point.

@nicolas-grekas nicolas-grekas force-pushed the php-config branch 5 times, most recently from ed6608e to 66b6c6a Compare August 25, 2025 13:26
@nicolas-grekas
Copy link
Copy Markdown
Member Author

All green \o/

Comment thread config/dbal.php
@ostrolucky ostrolucky added this to the 2.16.0 milestone Aug 27, 2025
@ostrolucky ostrolucky merged commit 8024bf3 into doctrine:2.16.x Aug 29, 2025
12 checks passed
Comment thread config/orm.php

->set('doctrine.orm.naming_strategy.underscore_number_aware', param('doctrine.orm.naming_strategy.underscore.class'))
->args([
'CASE_LOWER',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolas-grekas this should be an integer (the PHP constant), according to the UnderscoreNamingStrategy class

Just noticed in some deprecations :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arf, can you please send a PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, already merged by @stof :)

Comment thread config/dbal.php
->set('doctrine.dbal.events.oracle_session_init.class', OracleSessionInit::class)
->set('doctrine.class', Registry::class)
->set('doctrine.entity_managers', [])
->set('doctrine.default_entity_manager', null)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just use DBAL without the ORM and this change breaks my container:

TypeError: Doctrine\Bundle\DoctrineBundle\Registry::__construct(): Argument #5 ($defaultEntityManager) must be of type string, null given, called in /var/www/html/tests/app/var/cache/test/ContainerVbFK5Uk/getDoctrineService.php on line 27

It was <parameter key="doctrine.default_entity_manager"></parameter> in the XML config, which seems to result in an empty string instead of null.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that there's already an issue and a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants