Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Sep 19, 2012
1 parent 402b1ea commit 03602cc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/PHPCR/Util/Console/Command/ImportXmlCommand.php
Expand Up @@ -23,11 +23,11 @@ protected function configure()
$this $this
->setName('phpcr:import') ->setName('phpcr:import')
->addArgument('filename', null, 'The xml file to 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') ->setDescription('Import xml data into the repository, either in JCR system view format or arbitrary xml')
->setHelp(<<<EOF ->setHelp(<<<EOF
The <info>import</info> command uses the PHPCR Session::importXml method to The <info>import</info> command uses the PHPCR SessionInterface::importXml method
import an XML document into the repository. If the document is in the JCR 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 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 treated as document view format, meaning XML elements are translated to nodes
and XML attributes into properties. and XML attributes into properties.
Expand All @@ -54,7 +54,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (! $session->getRepository()->getDescriptor(RepositoryInterface::OPTION_XML_IMPORT_SUPPORTED)) { if (! $session->getRepository()->getDescriptor(RepositoryInterface::OPTION_XML_IMPORT_SUPPORTED)) {
throw new \RuntimeException('This repository does not support xml import'); 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->importXml($parentpath, $input->getArgument('filename'), ImportUUIDBehaviorInterface::IMPORT_UUID_CREATE_NEW);
$session->save(); $session->save();


Expand Down

0 comments on commit 03602cc

Please sign in to comment.