From c7af3497d55babda4d672999dc52ad925a467ec3 Mon Sep 17 00:00:00 2001 From: Stolz Date: Fri, 6 Mar 2015 14:29:20 +0100 Subject: [PATCH] Fixed custom pattern polling. Fixes #64. --- src/Manager.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index b714340..3b961ae 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -650,8 +650,19 @@ public function addDir($directory, $pattern = null) $this->css = array_unique(array_merge($this->css, $files)); // Unknown pattern. We must poll to know the asset type :( - else foreach($files as $asset) - $this->add($asset); + else + { + foreach($files as $asset) + { + if(preg_match($this->js_regex, $asset)) + $this->js[] = $asset; + + elseif(preg_match($this->css_regex, $asset)) + $this->css[] = $asset; + } + $this->js = array_unique($this->js); + $this->css = array_unique($this->css); + } return $this; }