From f8140478b219b2b98cb673886c2d9df599a44ca4 Mon Sep 17 00:00:00 2001 From: dantleech Date: Wed, 18 Mar 2015 08:13:51 +0000 Subject: [PATCH] Show exception for not-found globbed paths --- src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php | 5 +++++ src/PHPCR/Shell/DependencyInjection/Container.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php index 2ec5bb1a..126f1e6f 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php @@ -64,6 +64,7 @@ protected function configure() public function execute(InputInterface $input, OutputInterface $output) { + $globHelper = $this->get('dtl.glob.helper'); $this->formatter = $this->get('helper.result_formatter'); $this->textHelper = $this->get('helper.text'); $this->maxLevel = $input->getOption('level'); @@ -92,6 +93,10 @@ public function execute(InputInterface $input, OutputInterface $output) $nodes = array($session->getNodeByPathOrIdentifier($path)); $filter = null; } catch (\Exception $e) { + if (!$globHelper->isGlobbed($session->getAbsPath($path))) { + throw $e; + } + $parentPath = $this->get('helper.path')->getParentPath($path); $filter = substr($path, strlen($parentPath)); diff --git a/src/PHPCR/Shell/DependencyInjection/Container.php b/src/PHPCR/Shell/DependencyInjection/Container.php index 0c6c23be..e6ee0ba2 100644 --- a/src/PHPCR/Shell/DependencyInjection/Container.php +++ b/src/PHPCR/Shell/DependencyInjection/Container.php @@ -100,6 +100,8 @@ public function registerPhpcr() $repositoryDefinition->setFactoryService('phpcr.session_manager')->setFactoryMethod('getRepository'); $sessionDefinition->setFactoryService('phpcr.session_manager')->setFactoryMethod('getSession'); + + $this->register('dtl.glob.helper', 'DTL\Glob\GlobHelper'); } public function registerEvent()