Permalink
Browse files

cosmetics

  • Loading branch information...
1 parent 402b1ea commit 03602cc994c1e45b351424e137b2268249f34b3b @lsmith77 lsmith77 committed Sep 19, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 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(<<<EOF
-The <info>import</info> command uses the PHPCR Session::importXml method to
-import an XML document into the repository. If the document is in the JCR
+The <info>import</info> 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();

0 comments on commit 03602cc

Please sign in to comment.