From: Michael Wallner Date: Tue, 14 Oct 2014 16:39:26 +0000 (+0200) Subject: glob returns false on openshift X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d2f3d65b1f3b75da3c182f835883681dd6eef918;p=mdref%2Fmdref glob returns false on openshift --- diff --git a/mdref/Tree.php b/mdref/Tree.php index d9e2b0d..dd27d6f 100644 --- a/mdref/Tree.php +++ b/mdref/Tree.php @@ -13,7 +13,7 @@ class Tree implements \RecursiveIterator { * List of first level entries * @var array */ - private $list; + private $list = array(); /** * The list iterator @@ -29,8 +29,10 @@ class Tree implements \RecursiveIterator { if (!($list = glob("$path/*.md"))) { $list = glob("$path/*/*.md"); } - $this->list = array_filter($list, $this->generateFilter($list)); - sort($this->list, SORT_STRING); + if ($list) { + $this->list = array_filter($list, $this->generateFilter($list)); + sort($this->list, SORT_STRING); + } $this->repo = $repo; }