/** * @see Console\Command\Command */ protected function execute(InputInterface $input, OutputInterface $output) { $start = microtime(true); $this->output = $output; $this->output->write('Extracting datas... '); $logger = new Logger('Builder'); $logger->pushHandler(new NullHandler()); if ($input->getOption('verbose')) { $logger->pushHandler(new StreamHandler('php://stdout')); } $dumper = new InformationDumper(new Exiftool($logger)); $dump = $dumper->listDatas(InformationDumper::LISTTYPE_SUPPORTED_XML); $this->output->writeln('Done !'); $this->output->writeln('Generating classes... '); $this->extractDump($dump); if (!$input->getOption('write')) { $this->output->writeln('These classes were not written. Use --write to write on disk'); } else { $this->output->writeln('Erasing previous files... '); system('rm -R ' . __DIR__ . '/../../Driver/Tag/*'); system('rm -R ' . __DIR__ . '/../../Driver/Type/*'); $this->output->writeln('Writing files... '); $this->writeClasses($input->getOption('force')); } $this->output->writeln(sprintf('%d classes generated in %d seconds (%d Mb)', count($this->classes), microtime(true) - $start, memory_get_peak_usage() >> 20)); }
/** * @covers PHPExiftool\InformationDumper::listDatas * @covers \PHPExiftool\Exception\InvalidArgumentException * @expectedException \PHPExiftool\Exception\InvalidArgumentException */ public function testListDatasInvalidType() { $this->object->listDatas('Scrooge'); }