File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 2525 */
2626class Configuration implements ConfigurationInterface
2727{
28+ /** @var bool */
29+ private $ debug ;
30+
31+ /**
32+ * @param bool $debug Whether to use the debug mode
33+ */
34+ public function __construct (bool $ debug )
35+ {
36+ $ this ->debug = $ debug ;
37+ }
38+
2839 /**
2940 * Generates the configuration tree.
3041 *
@@ -147,6 +158,7 @@ public function getConfigTreeBuilder(): TreeBuilder
147158 })
148159 ->end ()
149160 ->end ()
161+ ->booleanNode ('profiler_enabled ' )->defaultValue ($ this ->debug )->end ()
150162 ->end ();
151163
152164 return $ treeBuilder ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class DoctrineMigrationsExtension extends Extension
4040 */
4141 public function load (array $ configs , ContainerBuilder $ container ): void
4242 {
43- $ configuration = new Configuration ( );
43+ $ configuration = $ this -> getConfiguration ( $ configs , $ container );
4444
4545 $ config = $ this ->processConfiguration ($ configuration , $ configs );
4646
@@ -169,4 +169,12 @@ public function getNamespace(): string
169169 {
170170 return 'http://symfony.com/schema/dic/doctrine/migrations/3.0 ' ;
171171 }
172+
173+ /**
174+ * {@inheritDoc}
175+ */
176+ public function getConfiguration (array $ config , ContainerBuilder $ container )
177+ {
178+ return new Configuration ($ container ->getParameter ('kernel.debug ' ));
179+ }
172180}
You can’t perform that action at this time.
0 commit comments