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:
Netkas 2023-10-18 16:03:40 -04:00
parent 89d3af8680
commit 698d2e7a1f
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 19 additions and 4 deletions

View file

@ -12,6 +12,7 @@ This update introduces minor bug fixes.
### Fixed
- Improve build efficiency by preventing duplicate merges
- Updated file tracking in Runtime class
## [2.0.3] - 2023-10-17

View file

@ -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);