/**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $inputFilePath = $input->getOption('input-dir') . DIRECTORY_SEPARATOR . $input->getOption('input-file');
     if (!file_exists($inputFilePath)) {
         throw new \RuntimeException(sprintf('Unable to find the "%s" configuration file', $inputFilePath));
     }
     $this->createDirectory($input->getOption('output-dir'));
     $outputFilePath = $input->getOption('output-dir') . DIRECTORY_SEPARATOR . $input->getOption('output-file');
     if (!is_writable(dirname($outputFilePath))) {
         throw new \RuntimeException(sprintf('Unable to write the "%s" output file', $outputFilePath));
     }
     $stringConf = file_get_contents($inputFilePath);
     $arrayConf = XmlToArrayConverter::convert($stringConf);
     $phpConf = ArrayToPhpConverter::convert($arrayConf);
     $phpConf = "<?php\n" . $phpConf;
     if (file_exists($outputFilePath)) {
         $currentContent = file_get_contents($outputFilePath);
         if ($currentContent == $phpConf) {
             $output->writeln(sprintf('No change required in the current configuration file <info>"%s"</info>.', $outputFilePath));
         } else {
             file_put_contents($outputFilePath, $phpConf);
             $output->writeln(sprintf('Successfully updated PHP configuration in file <info>"%s"</info>.', $outputFilePath));
         }
     } else {
         file_put_contents($outputFilePath, $phpConf);
         $output->writeln(sprintf('Successfully wrote PHP configuration in file <info>"%s"</info>.', $outputFilePath));
     }
 }
    public function testConvertConvertsProfilerSectionInsidePropelElement()
    {
        $xml = <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<config>
  <propel>
    <profiler class="\\Runtime\\Runtime\\Util\\Profiler">
      <slowTreshold>0.2</slowTreshold>
      <details>
        <time name="Time" precision="3" pad="8" />
        <mem name="Memory" precision="3" pad="8" />
      </details>
      <innerGlue>: </innerGlue>
      <outerGlue> | </outerGlue>
    </profiler>
  </propel>
 </config>
EOF;
        $converted = XmlToArrayConverter::convert($xml);
        $expected = array('profiler' => array('class' => '\\Runtime\\Runtime\\Util\\Profiler', 'slowTreshold' => 0.2, 'details' => array('time' => array('name' => 'Time', 'precision' => 3, 'pad' => '8'), 'mem' => array('name' => 'Memory', 'precision' => 3, 'pad' => '8')), 'innerGlue' => ': ', 'outerGlue' => ' | '));
        $this->assertEquals($expected, $converted);
    }