8000 Check for eval() string earlier to make best use of caching · symfony/symfony@88d9846 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88d9846

Browse files
committed
Check for eval() string earlier to make best use of caching
1 parent c1ccb0c commit 88d9846

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,18 @@ private function darwinRealpath($real)
390390

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

393+
if (!isset($dirFiles[$file]) && ') : eval()\'d code' === substr($file, -17)) {
394+
// Get the file name from "file_name.php(123) : eval()'d code"
395+
$file = substr($file, 0, strrpos($file, '(', -17));
396+
}
397+
393398
if (isset($dirFiles[$file])) {
394399
return $real .= $dirFiles[$file];
395400
}
396401

397402
$kFile = strtolower($file);
398403

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

0 commit comments

Comments
 (0)
0