-
Notifications
You must be signed in to change notification settings - Fork 9.4k
improve and make more strict autoload.php #28923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
magento-engcom-team
merged 1 commit into
magento:2.4-develop
from
rvitaliy:feature/improve-autoload-php
Aug 15, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rvitaliy. Thank you for your collaboration. Could I kindly ask you to provide a comment for these two declarations of
$vendorAutoload
with highlighting what is a particular block for? At first glance, these blocks of code look very similar (almost the same) and it's hard to guess why we need such an approach. I see that in first case we have the trailing slash, but let's make developers life a little bit easier and highlight this case in the comments. Thank you!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rogyar
sorry, but i can't do it.
personally i don't undestand why we need the second check without BP prefix.
i'm refactor the old code without change to the logics, make it more strict and readable.
IMHO: we can remove the second block of check,
app/{$vendor}
is not a valid path for vendor.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I see that this functionality has been recently added. So I assume it was done for a purpose.
2054fab
Unfortunately, there's no additional information about this change. Well then, let's leave it as it is. Maybe it's required for some particular circumstances (like CI system or so).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rogyar, that commit is from #18849, so there is your missing information 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the second check is need to autoload vendors from the global path