PHPExiftool\InformationDumper::listDatas PHP Method

listDatas() public method

Return the result of a Exiftool -list* command
See also: http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#item__2dlist_2c__2dlistw_2c__2dlistf_2c__2dlistr_2c__2d
public listDatas ( string $type = self::LISTTYPE_SUPPORTED_XML ) : type
$type string One of the LISTTYPE_* constants
return type
    public function listDatas($type = self::LISTTYPE_SUPPORTED_XML)
    {
        $available = array(self::LISTTYPE_WRITABLE, self::LISTTYPE_SUPPORTED_FILEEXT, self::LISTTYPE_WRITABLE_FILEEXT, self::LISTTYPE_SUPPORTED_XML, self::LISTTYPE_DELETABLE_GROUPS, self::LISTTYPE_GROUPS);
        if (!in_array($type, $available)) {
            throw new InvalidArgumentException('Unknown list attribute');
        }
        return $this->exiftool->executeCommand('-f -list' . $type);
    }

Usage Example

 /**
  * @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));
 }
All Usage Examples Of PHPExiftool\InformationDumper::listDatas
InformationDumper