File tree Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace ClawRock \Debug \Console \Command ;
4
+
5
+ use Symfony \Component \Console \Command \Command ;
6
+ use Symfony \Component \Console \Input \InputInterface ;
7
+ use Symfony \Component \Console \Output \OutputInterface ;
8
+
9
+ class DatabaseProfilerDisableCommand extends Command
10
+ {
11
+ /**
12
+ * @var \ClawRock\Debug\Model\Config\Database\ProfilerWriter
13
+ */
14
+ private $ profilerWriter ;
15
+
16
+ public function __construct (
17
+ \ClawRock \Debug \Model \Config \Database \ProfilerWriter $ profilerWriter
18
+ ) {
19
+ parent ::__construct ('debug:db-profiler:disable ' );
20
+
21
+ $ this ->profilerWriter = $ profilerWriter ;
22
+ }
23
+
24
+ protected function configure ()
25
+ {
26
+ parent ::configure ();
27
+
28
+ $ this ->setDescription ('Disable database profiler required for database collector. ' );
29
+ }
30
+
31
+ /**
32
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
33
+ */
34
+ protected function execute (InputInterface $ input , OutputInterface $ output )
35
+ {
36
+ $ this ->profilerWriter ->save (false );
37
+
38
+ $ output ->writeLn ('<info>Database profiler disabled!</info> ' );
39
+ }
40
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace ClawRock \Debug \Console \Command ;
4
+
5
+ use Symfony \Component \Console \Command \Command ;
6
+ use Symfony \Component \Console \Input \InputInterface ;
7
+ use Symfony \Component \Console \Output \OutputInterface ;
8
+
9
+ class DatabaseProfilerEnableCommand extends Command
10
+ {
11
+ /**
12
+ * @var \ClawRock\Debug\Model\Config\Database\ProfilerWriter
13
+ */
14
+ private $ profilerWriter ;
15
+
16
+ public function __construct (
17
+ \ClawRock \Debug \Model \Config \Database \ProfilerWriter $ profilerWriter
18
+ ) {
19
+ parent ::__construct ('debug:db-profiler:enable ' );
20
+
21
+ $ this ->profilerWriter = $ profilerWriter ;
22
+ }
23
+
24
+ protected function configure ()
25
+ {
26
+ parent ::configure ();
27
+
28
+ $ this ->setDescription ('Enable database profiler required for database collector. ' );
29
+ }
30
+
31
+ /**
32
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
33
+ */
34
+ protected function execute (InputInterface $ input , OutputInterface $ output )
35
+ {
36
+ $ this ->profilerWriter ->save (true );
37
+
38
+ $ output ->writeLn ('<info>Database profiler enabled!</info> ' );
39
+ }
40
+ }
Original file line number Diff line number Diff line change 84
84
</argument >
85
85
</arguments >
86
86
</type >
87
+ <type name =" Magento\Framework\Console\CommandListInterface" >
88
+ <arguments >
89
+ <argument name =" commands" xsi : type =" array" >
90
+ <item name =" ClawRock_Debug::enable_database_profiler" xsi : type =" object" >ClawRock\Debug\Console\Command\DatabaseProfilerEnableCommand</item >
91
+ <item name =" ClawRock_Debug::disable_database_profiler" xsi : type =" object" >ClawRock\Debug\Console\Command\DatabaseProfilerDisableCommand</item >
92
+ </argument >
93
+ </arguments >
94
+ </type >
87
95
</config >
You can’t perform that action at this time.
0 commit comments