diff --git a/src/PHPCR/Util/Console/Command/ImportXmlCommand.php b/src/PHPCR/Util/Console/Command/ImportXmlCommand.php index 0587d47..7f61fa3 100644 --- a/src/PHPCR/Util/Console/Command/ImportXmlCommand.php +++ b/src/PHPCR/Util/Console/Command/ImportXmlCommand.php @@ -23,11 +23,11 @@ protected function configure() $this ->setName('phpcr:import') ->addArgument('filename', null, 'The xml file to import') - ->addOption('parentpath', 'p', InputOption::VALUE_OPTIONAL, 'Repository path to the parent where to import the file contents') + ->addOption('parentpath', 'p', InputOption::VALUE_OPTIONAL, 'Repository path to the parent where to import the file contents', '/') ->setDescription('Import xml data into the repository, either in JCR system view format or arbitrary xml') ->setHelp(<<import command uses the PHPCR Session::importXml method to -import an XML document into the repository. If the document is in the JCR +The import command uses the PHPCR SessionInterface::importXml method +to import an XML document into the repository. If the document is in the JCR system view format, it is interpreted according to the spec, otherwise it is treated as document view format, meaning XML elements are translated to nodes and XML attributes into properties. @@ -54,7 +54,8 @@ protected function execute(InputInterface $input, OutputInterface $output) if (! $session->getRepository()->getDescriptor(RepositoryInterface::OPTION_XML_IMPORT_SUPPORTED)) { throw new \RuntimeException('This repository does not support xml import'); } - $parentpath = $input->getOption('parentpath') ? $input->getOption('parentpath') : '/'; + + $parentpath = $input->getOption('parentpath'); $session->importXml($parentpath, $input->getArgument('filename'), ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW); $session->save();