/ composer Public
Explicitly check if a file has already been required before requiring it #4186
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
This would address #3003 by assigning an identifier to each included file during
AutoloadGenerator::dump. Currently, this identifier is the value returned by
md5_file(to address the concern raised in guzzle/guzzle#676 (comment)), but it could also be a logical file address such as
This is preferable to simple changing
require_oncebecause it prevents two copies of the same file from being loaded, as would happen if a globally installed package loads project's autoloader and both rely on the same package. A known example of this is using a globally installed copy of CodeCeption on a project requiring Guzzle.
Would also address: