Skip to content

Commit fcd5190

Browse files
committed
fix command to work with paths again
1 parent 52913c8 commit fcd5190

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/PHPCR/Util/Console/Command/DumpCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
115115
}
116116

117117
try {
118-
$node = $session->getNodeByIdentifier($identifier);
118+
if (strpos($identifier, '/') === 0) {
119+
$node = $session->getNode($identifier);
120+
} else {
121+
$node = $session->getNodeByIdentifier($identifier);
122+
}
119123
$walker->traverse($node, $input->getOption('depth'));
120124
} catch (RepositoryException $e) {
121125
if ($e instanceof PathNotFoundException || $e instanceof ItemNotFoundException) {
122126
$output->writeln("<error>Path '$identifier' does not exist</error>");
123-
124-
return 1;
125127
}
128+
$output->writeln('<error>Error: '.$e->getMessage().'</error>');
129+
130+
return 1;
126131
}
127132

128133
return 0;

0 commit comments

Comments
 (0)