From 0fd7e9e2af1dfa2e8f13a19183a8a74c3e4bff31 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 21 Mar 2014 21:04:02 +0000 Subject: [PATCH] Improved resources --- src/Whoops/Handler/PrettyPageHandler.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Whoops/Handler/PrettyPageHandler.php b/src/Whoops/Handler/PrettyPageHandler.php index 30806c9..6302983 100644 --- a/src/Whoops/Handler/PrettyPageHandler.php +++ b/src/Whoops/Handler/PrettyPageHandler.php @@ -373,7 +373,7 @@ class PrettyPageHandler extends Handler ); } - $this->searchPaths[] = $path; + array_unshift($this->searchPaths, $path); } /** @@ -414,10 +414,10 @@ class PrettyPageHandler extends Handler return $this->resourceCache[$resource]; } - // Search through available search paths, in reverse order, - // until we find the resource we're after: - for($i = count($this->searchPaths) - 1; $i >= 0; $i--) { - $fullPath = $this->searchPaths[$i] . "/$resource"; + // Search through available search paths, until we find the + // resource we're after: + foreach($this->searchPaths as $path) { + $fullPath = $path . "/$resource"; if(is_file($fullPath)) { // Cache the result: