mirror of
https://github.com/filp/whoops.git
synced 2026-08-30 03:58:17 +00:00
@@ -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:
|
||||
@@ -442,8 +442,8 @@ class PrettyPageHandler extends Handler
|
||||
{
|
||||
$allPaths = $this->getResourcePaths();
|
||||
|
||||
// Compat: return only the first path
|
||||
return reset($allPaths) ?: null;
|
||||
// Compat: return only the first path added
|
||||
return end($allPaths) ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,7 +76,7 @@ class PrettyPageHandlerTest extends TestCase
|
||||
$allPaths = $handler->getResourcePaths();
|
||||
|
||||
$this->assertCount(2, $allPaths);
|
||||
$this->assertEquals($allPaths[1], $path);
|
||||
$this->assertEquals($allPaths[0], $path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user