Skip to content

Commit

Permalink
Improved resources
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Mar 21, 2014
1 parent a0731dd commit 0fd7e9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Whoops/Handler/PrettyPageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function addResourcePath($path)
);
}

$this->searchPaths[] = $path;
array_unshift($this->searchPaths, $path);
}

/**
Expand Down Expand Up @@ -414,10 +414,10 @@ protected function getResource($resource)
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:
Expand Down

0 comments on commit 0fd7e9e

Please sign in to comment.