protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectMagento($output, true);
if (!$this->initMagento()) {
return;
}
$this->writeSection($output, 'Config Search');
$searchString = $input->getArgument('text');
$system = \Mage::getConfig()->loadModulesConfiguration('system.xml');
$matches = $this->_searchConfiguration($searchString, $system);
if (count($matches) > 0) {
foreach ($matches as $match) {
$output->writeln('Found a <comment>' . $match->type . '</comment> with a match');
$output->writeln(' ' . $this->_getPhpMageStoreConfigPathFromMatch($match));
$output->writeln(' ' . $this->_getPathFromMatch($match));
if ($match->match_type == 'comment') {
$output->writeln(' ' . str_ireplace($searchString, '<info>' . $searchString . '</info>', (string) $match->node->comment));
}
$output->writeln('');
}
} else {
$output->writeln('<info>No matches for <comment>' . $searchString . '</comment></info>');
}
}