Skip to content

Commit 2954889

Browse files
committed
Add DotenvDebugCommand
1 parent c8f18ee commit 2954889

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
use Symfony\Component\DependencyInjection\Parameter;
5959
use Symfony\Component\DependencyInjection\Reference;
6060
use Symfony\Component\DependencyInjection\ServiceLocator;
61+
use Symfony\Component\Dotenv\Command\DebugCommand;
6162
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
6263
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
6364
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
@@ -251,6 +252,10 @@ public function load(array $configs, ContainerBuilder $container)
251252
if (!class_exists(BaseYamlLintCommand::class)) {
252253
$container->removeDefinition('console.command.yaml_lint');
253254
}
255+
256+
if (!class_exists(DebugCommand::class)) {
257+
$container->removeDefinition('console.command.dotenv_debug');
258+
}
254259
}
255260

256261
// Load Cache configuration first as it is used by other components

Resources/config/console.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
use Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand;
4040
use Symfony\Bundle\FrameworkBundle\EventListener\SuggestMissingPackageSubscriber;
4141
use Symfony\Component\Console\EventListener\ErrorListener;
42+
use Symfony\Component\Dotenv\Command\DebugCommand as DotenvDebugCommand;
4243
use Symfony\Component\Messenger\Command\ConsumeMessagesCommand;
4344
use Symfony\Component\Messenger\Command\DebugCommand;
4445
use Symfony\Component\Messenger\Command\FailedMessagesRemoveCommand;
@@ -129,6 +130,13 @@
129130
])
130131
->tag('console.command')
131132

133+
->set('console.command.dotenv_debug', DotenvDebugCommand::class)
134+
->args([
135+
param('kernel.environment'),
136+
param('kernel.project_dir'),
137+
])
138+
->tag('console.command')
139+
132140
->set('console.command.event_dispatcher_debug', EventDispatcherDebugCommand::class)
133141
->args([
134142
tagged_locator('event_dispatcher.dispatcher', 'name'),

0 commit comments

Comments
 (0)