Skip to content

Commit

Permalink
Check for eval() string earlier to make best use of caching
Browse files Browse the repository at this point in the history
  • Loading branch information
skalpa committed Feb 24, 2019
1 parent c1ccb0c commit 88d9846
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Symfony/Component/Debug/DebugClassLoader.php
Expand Up @@ -390,17 +390,18 @@ private function darwinRealpath($real)

$dirFiles = self::$darwinCache[$kDir][1];

if (!isset($dirFiles[$file]) && ') : eval()\'d code' === substr($file, -17)) {
// Get the file name from "file_name.php(123) : eval()'d code"
$file = substr($file, 0, strrpos($file, '(', -17));
}

if (isset($dirFiles[$file])) {
return $real .= $dirFiles[$file];
}

$kFile = strtolower($file);

if (!isset($dirFiles[$kFile])) {
if (') : eval()\'d code' === substr($kFile, -17)) {
// Get the file name from "file_name.php(123) : eval()'d code"
$kFile = substr($kFile, 0, strrpos($kFile, '(', -17));
}
foreach (scandir($real, 2) as $f) {
if ('.' !== $f[0]) {
$dirFiles[$f] = $f;
Expand Down

0 comments on commit 88d9846

Please sign in to comment.