Updated file tracking in Runtime class
Implemented changes in Runtime.php to better handle file tracking and to prevent unnecessary inclusion of duplicate files during Runtime. Instead of directly checking if a file is already included, we now create a unique identifier for each file using a crc32 hash function. This identifier (instead of the file path) is checked and stored in the inclusion list, allowing for better handling of dynamic or virtual files.
This commit is contained in:
parent
89d3af8680
commit
698d2e7a1f
2 changed files with 19 additions and 4 deletions
|
@ -572,9 +572,16 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if(!in_array($path, self::$included_files, true))
|
||||
$acquired_name = $path;
|
||||
|
||||
if(!is_file($path))
|
||||
{
|
||||
self::$included_files[] = $path;
|
||||
$acquired_name = hash('crc32', $acquired_file);
|
||||
}
|
||||
|
||||
if(!in_array($acquired_name, self::$included_files, true))
|
||||
{
|
||||
self::$included_files[] = sprintf('virtual(%s)', $acquired_name);
|
||||
}
|
||||
|
||||
self::extendedEvaluate($acquired_file);
|
||||
|
@ -617,9 +624,16 @@
|
|||
throw new RuntimeException(sprintf('Failed to acquire file "%s" at runtime: %s', $path, $e->getMessage()), $e->getCode(), $e);
|
||||
}
|
||||
|
||||
if(!in_array($path, self::$included_files, true))
|
||||
$acquired_name = $path;
|
||||
|
||||
if(!is_file($path))
|
||||
{
|
||||
self::$included_files[] = $path;
|
||||
$acquired_name = hash('crc32', $acquired_file);
|
||||
}
|
||||
|
||||
if(!in_array($acquired_name, self::$included_files, true))
|
||||
{
|
||||
self::$included_files[] = sprintf('virtual(%s)', $acquired_name);
|
||||
}
|
||||
|
||||
self::extendedEvaluate($acquired_file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue