Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
QueryLogDisableCommand.php
Go to the documentation of this file.
1 <?php
8 
9 use Symfony\Component\Console\Command\Command;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
15 
16 class QueryLogDisableCommand extends Command
17 {
21  const COMMAND_NAME = 'dev:query-log:disable';
22 
26  const SUCCESS_MESSAGE = "DB query logging disabled.";
27 
31  private $deployConfigWriter;
32 
38  public function __construct(
39  Writer $deployConfigWriter,
40  $name = null
41  ) {
42  parent::__construct($name);
43  $this->deployConfigWriter = $deployConfigWriter;
44  }
45 
49  protected function configure()
50  {
51  $this->setName(self::COMMAND_NAME)
52  ->setDescription('Disable DB query logging');
53 
54  parent::configure();
55  }
56 
61  protected function execute(InputInterface $input, OutputInterface $output)
62  {
64  $this->deployConfigWriter->saveConfig([ConfigFilePool::APP_ENV => [LoggerProxy::CONF_GROUP_NAME => $data]]);
65 
66  $output->writeln("<info>". self::SUCCESS_MESSAGE . "</info>");
67  }
68 }
execute(InputInterface $input, OutputInterface $output)
if(!isset($_GET['name'])) $name
Definition: log.php:14