From 8efa3e469d87a701783c60b2a60dac00135559a3 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 14 Oct 2014 18:25:07 +0200 Subject: [PATCH] fix discovery of subentries --- mdref/Entry.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mdref/Entry.php b/mdref/Entry.php index 587cd1e..5292fff 100644 --- a/mdref/Entry.php +++ b/mdref/Entry.php @@ -218,9 +218,10 @@ class Entry implements \IteratorAggregate { * @param string $glob * @return boolean */ - function hasIterator($glob = null) { + function hasIterator($glob = null, $loose = false) { if (strlen($glob)) { - return glob($this->getBasename() . "/$glob"); + return glob($this->getBasename() . "/$glob") || + ($loose && glob($this->getBasename() . "/*/$glob")); } elseif ($this->isRoot()) { return true; } else { @@ -233,7 +234,7 @@ class Entry implements \IteratorAggregate { * @return bool */ function hasNsClasses() { - return $this->hasIterator("/[A-Z]*.md"); + return $this->hasIterator("/[A-Z]*.md", true); } /** @@ -249,6 +250,6 @@ class Entry implements \IteratorAggregate { * @return \mdref\Tree child nodes */ function getIterator() { - return new Tree($this->getBasename(), $this->repo, $this->isRoot()); + return new Tree($this->getBasename(), $this->repo); } } -- 2.30.2