8000 Added warning about performances · symfony/symfony-docs@11bfe50 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11bfe50

Browse files
author
Loïc Chardonnet
committed
Added warning about performances
1 parent 6a7a25f commit 11bfe50

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

components/console/commands_as_services.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ defining it with the ``console.command`` tag:
6161
->addTag('console.command')
6262
;
6363
64-
Use Case: Using Dependencies and Parameters to Set Default Values for Options
65-
-----------------------------------------------------------------------------
64+
Using Dependencies and Parameters to Set Default Values for Options
65+
-------------------------------------------------------------------
6666

6767
Imagine you want to provide a default value for the ``name``option. You could
6868
pass one of the following as the 5th argument of ``addOption()``:
@@ -111,3 +111,9 @@ constructor. The only solution is to inject them through it::
111111
$output->writeln($name);
112112
}
113113
}
114+
115+
.. caution::
116+
117+
When running the console, every commands are instanciated, which means every
118+
``configure()`` methods are called. Be careful with database queries, as
119+
this could impact performances.

0 commit comments

Comments
 (0)
0