Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DoctrineBundle] Add infos about disabling the Autocommit mode #20824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: 7.2
Choose a base branch
Loading
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add missing quotes and missing xsd schema
  • Loading branch information
Crovitche-1623 authored Mar 25, 2025
commit e3027d906123678424b884754274ef0b86209b9f
10 changes: 7 additions & 3 deletions 10 reference/configuration/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,28 @@
# This line disables auto-commit at the DBAL level:
auto_commit: false

.. code-block:: xml

Check failure on line 189 in reference/configuration/doctrine.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please add a blank line after " .. code-block:: xml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd>
https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine
https://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">

<doctrine:config>
<doctrine:dbal
auto-commit="false"
>
<!-- Only if you are using DBAL with PDO -->
<doctrine:option key-type="constant" key="PDO::ATTR_AUTOCOMMIT">false</doctrine:option>
<doctrine:connection name="default">
<doctrine:option key-type="constant" key="PDO::ATTR_AUTOCOMMIT">false</doctrine:option>
</doctrine:connection>
</doctrine:dbal>
</doctrine:config>
</container>


If you are managing your database migrations using the `Doctrine Migrations Bundle`_, you must also register a listener to ensure that the last migration is properly commited:
Crovitche-1623 marked this conversation as resolved.
Show resolved Hide resolved

.. configuration-block::
Expand All @@ -217,7 +221,7 @@
- name: doctrine.event_listener
event: !php/const Doctrine\Migrations\Events::onMigrationsMigrated

.. code-block:: xml

Check failure on line 224 in reference/configuration/doctrine.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Yaml syntax] The constant "Doctrine\Migrations\Events::onMigrationsMigrated" is not defined at line 8 (near "event: !php/const Doctrine\Migrations\Events::onMigrationsMigrated").

<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
Expand All @@ -228,7 +232,7 @@

<services>
<service id="Doctrine\Migrations\Event\Listeners\AutoCommitListener">
<tag name="doctrine.event_listener" event="onMigrationsMigrated" />

Check failure on line 235 in reference/configuration/doctrine.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove space before "/>"
</service>
</services>
</container>
Expand All @@ -238,8 +242,8 @@
// config/services.php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Doctrine\Migrations\Event\Listeners\AutoCommitListener;

Check failure on line 245 in reference/configuration/doctrine.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Missing class] Class, interface or trait with name "Doctrine\Migrations\Event\Listeners\AutoCommitListener" does not exist
use Doctrine\Migrations\Events;

Check failure on line 246 in reference/configuration/doctrine.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Missing class] Class, interface or trait with name "Doctrine\Migrations\Events" does not exist

return function(ContainerConfigurator $container): void {
$services = $container->services();
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.