Skip to content

Commit 0f42bea

Browse files
committed
Merge pull request #147 from phpcr/allow_exception_for_invalid_non_globbed_path
Show exception for not-found globbed paths
2 parents 6e1d805 + f814047 commit 0f42bea

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ protected function configure()
6464

6565
public function execute(InputInterface $input, OutputInterface $output)
6666
{
67+
$globHelper = $this->get('dtl.glob.helper');
6768
$this->formatter = $this->get('helper.result_formatter');
6869
$this->textHelper = $this->get('helper.text');
6970
$this->maxLevel = $input->getOption('level');
@@ -92,6 +93,10 @@ public function execute(InputInterface $input, OutputInterface $output)
9293
$nodes = array($session->getNodeByPathOrIdentifier($path));
9394
$filter = null;
9495
} catch (\Exception $e) {
96+
if (!$globHelper->isGlobbed($session->getAbsPath($path))) {
97+
throw $e;
98+
}
99+
95100
$parentPath = $this->get('helper.path')->getParentPath($path);
96101

97102
$filter = substr($path, strlen($parentPath));

src/PHPCR/Shell/DependencyInjection/Container.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public function registerPhpcr()
100100

101101
$repositoryDefinition->setFactoryService('phpcr.session_manager')->setFactoryMethod('getRepository');
102102
$sessionDefinition->setFactoryService('phpcr.session_manager')->setFactoryMethod('getSession');
103+
104+
$this->register('dtl.glob.helper', 'DTL\Glob\GlobHelper');
103105
}
104106

105107
public function registerEvent()

0 commit comments

Comments
 (0)