Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 8 additions & 3 deletions config/dbal.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
->set('doctrine.dbal.schema_asset_filter_manager', SchemaAssetsFilterManager::class)
->abstract()

->set('doctrine.manager_registry_aware_connection_provider', ManagerRegistryAwareConnectionProvider::class)
->args([
service('doctrine'),
])

->set('doctrine.database_create_command', CreateDatabaseDoctrineCommand::class)
->args([
service('doctrine'),
Expand All @@ -93,13 +98,13 @@
])
->tag('console.command', ['command' => 'doctrine:database:drop'])

->set(RunSqlCommand::class)
->set('doctrine.run_sql_command', RunSqlCommand::class)
->args([
service(ManagerRegistryAwareConnectionProvider::class)->nullOnInvalid(),
service('doctrine.manager_registry_aware_connection_provider'),
])
->tag('console.command', ['command' => 'dbal:run-sql'])

->set(ProfilerController::class)
->set('doctrine.profiler_controller', ProfilerController::class)
->args([
service('twig'),
service('doctrine'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler;

use Doctrine\Bundle\DoctrineBundle\Controller\ProfilerController;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Expand All @@ -17,6 +16,6 @@ public function process(ContainerBuilder $container): void
return;
}

$container->removeDefinition(ProfilerController::class);
$container->removeDefinition('doctrine.profiler_controller');
}
}
6 changes: 0 additions & 6 deletions src/DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Doctrine\Bundle\DoctrineBundle\Attribute\AsMiddleware;
use Doctrine\Bundle\DoctrineBundle\CacheWarmer\DoctrineMetadataCacheWarmer;
use Doctrine\Bundle\DoctrineBundle\ConnectionFactory;
use Doctrine\Bundle\DoctrineBundle\Dbal\ManagerRegistryAwareConnectionProvider;
use Doctrine\Bundle\DoctrineBundle\Dbal\RegexSchemaAssetFilter;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\IdGeneratorPass;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass;
Expand Down Expand Up @@ -640,11 +639,6 @@ private function loadDbalConnection(string $name, array $connection, ContainerBu
$def->setClass($options['wrapperClass']);
}

$container->setDefinition(
ManagerRegistryAwareConnectionProvider::class,
new Definition(ManagerRegistryAwareConnectionProvider::class, [$container->getDefinition('doctrine')]),
);

$configuration->addMethodCall('setSchemaManagerFactory', [new Reference($connection['schema_manager_factory'])]);

if (! isset($connection['result_cache'])) {
Expand Down
2 changes: 1 addition & 1 deletion templates/Collector/db.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

{% block panel %}
{% if 'explain' == page %}
{{ render(controller('Doctrine\\Bundle\\DoctrineBundle\\Controller\\ProfilerController::explainAction', {
{{ render(controller('doctrine.profiler_controller::explainAction', {
token: token,
panel: 'db',
connectionName: request.query.get('connection'),
Expand Down