File tree Expand file tree Collapse file tree 3 files changed +128
-0
lines changed
app/code/Magento/Developer Expand file tree Collapse file tree 3 files changed +128
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Developer \Console \Command ;
8
+
9
+ use Symfony \Component \Console \Command \Command ;
10
+ use Symfony \Component \Console \Input \InputInterface ;
11
+ use Symfony \Component \Console \Output \OutputInterface ;
12
+
13
+ class TemplateHintsDisableCommand extends Command
14
+ {
15
+ /**
16
+ * command name
17
+ */
18
+ const COMMAND_NAME = 'dev:template-hints:disable ' ;
19
+
20
+ /**
21
+ * Success message
22
+ */
23
+ const SUCCESS_MESSAGE = "Template hints disabled. Refresh cache types " ;
24
+
25
+ /**
26
+ * TemplateHintsDisableCommand constructor.
27
+ * @param \Magento\Config\Model\ResourceModel\Config $resourceConfig
28
+ */
29
+ public function __construct (
30
+ \Magento \Config \Model \ResourceModel \Config $ resourceConfig
31
+ ) {
32
+ parent ::__construct ();
33
+ $ this ->_resourceConfig = $ resourceConfig ;
34
+ }
35
+
36
+ /**
37
+ * {@inheritdoc}
38
+ */
39
+ protected function configure ()
40
+ {
41
+ $ this ->setName (self ::COMMAND_NAME )
42
+ ->setDescription ('Disable frontend template hints. A cache flush might be required. ' );
43
+
44
+ parent ::configure ();
45
+ }
46
+
47
+ /**
48
+ * {@inheritdoc}
49
+ * @throws \InvalidArgumentException
50
+ */
51
+ protected function execute (InputInterface $ input , OutputInterface $ output )
52
+ {
53
+ $ this ->_resourceConfig ->saveConfig (
54
+ 'dev/debug/template_hints_storefront ' ,
55
+ 0 ,
56
+ 'default ' ,
57
+ 0
58
+ );
59
+
60
+ $ output ->writeln ("<info> " . self ::SUCCESS_MESSAGE . "</info> " );
61
+ }
62
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Developer \Console \Command ;
8
+
9
+ use Symfony \Component \Console \Command \Command ;
10
+ use Symfony \Component \Console \Input \InputInterface ;
11
+ use Symfony \Component \Console \Output \OutputInterface ;
12
+
13
+
14
+ class TemplateHintsEnableCommand extends Command
15
+ {
16
+
17
+ /**
18
+ * command name
19
+ */
20
+ const COMMAND_NAME = 'dev:template-hints:enable ' ;
21
+
22
+ /**
23
+ * Success message
24
+ */
25
+ const SUCCESS_MESSAGE = "Template hints enabled. " ;
26
+
27
+ /**
28
+ * TemplateHintsDisableCommand constructor.
29
+ * @param \Magento\Config\Model\ResourceModel\Config $resourceConfig
30
+ */
31
+ public function __construct (
32
+ \Magento \Config \Model \ResourceModel \Config $ resourceConfig
33
+ ) {
34
+ parent ::__construct ();
35
+ $ this ->_resourceConfig = $ resourceConfig ;
36
+ }
37
+
38
+ /**
39
+ * {@inheritdoc}
40
+ */
41
+ protected function configure ()
42
+ {
43
+ $ this ->setName (self ::COMMAND_NAME )
44
+ ->setDescription ('Disable frontend template hints. A cache flush might be required. ' );
45
+
46
+ parent ::configure ();
47
+ }
48
+
49
+ /**
50
+ * {@inheritdoc}
51
+ * @throws \InvalidArgumentException
52
+ */
53
+ protected function execute (InputInterface $ input , OutputInterface $ output )
54
+ {
55
+ $ this ->_resourceConfig ->saveConfig (
56
+ 'dev/debug/template_hints_storefront ' ,
57
+ 1 ,
58
+ 'default ' ,
59
+ 0
60
+ );
61
+
62
+ $ output ->writeln ("<info> " . self ::SUCCESS_MESSAGE . "</info> " );
63
+ }
64
+ }
Original file line number Diff line number Diff line change 100
100
<item name =" dev_di_info" xsi : type =" object" >Magento\Developer\Console\Command\DiInfoCommand</item >
101
101
<item name =" dev_query_log_enable" xsi : type =" object" >Magento\Developer\Console\Command\QueryLogEnableCommand</item >
102
102
<item name =" dev_query_log_disable" xsi : type =" object" >Magento\Developer\Console\Command\QueryLogDisableCommand</item >
103
+ <item name =" dev_template_hints_disable" xsi : type =" object" >Magento\Developer\Console\Command\TemplateHintsDisableCommand</item >
104
+ <item name =" dev_template_hints_enable" xsi : type =" object" >Magento\Developer\Console\Command\TemplateHintsEnableCommand</item >
103
105
</argument >
104
106
</arguments >
105
107
</type >
You can’t perform that action at this time.
0 commit comments