User tests: Successful: Unsuccessful:
Pull Request for Issue #15041.
This is a redo of #15075 because I don't know how to resolve conflicts, sorry. There are some changes in this PR:
Code review by Joomla 4 team only.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
Labels |
Added:
?
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-12 12:11:07 |
Closed_By | ⇒ | wilsonge |
@joomdonation just noticed, shouldn't we use addPsr4 instead of setPsr4? set overrides, add adds :)
No because otherwise when you create a second dispatcher instance (e.g. in a second module you are going to end up adding the same path multiple times no?
Set overrides, is there any reason we would like to do that?
Is it a problem to only have a single prefix per component?
In theory someone could still manipulate the class loader to put their custom paths before the core paths (same way you can now if you know what you're doing with JControllerLegacy, JModelLegacy, and JTable). So I think we'd want to use the adder over the setter.
With the reason explains by Michael, I agree that using addPsr4 would be better (at least in theory). When a dispatcher is created a second time for example, yes, the same paths will be added again but it doesn't cost much (just two new elements added to the paths array)
However, with the RFC #15226 by Allon (which looks like I agree), we won't need autoLoad method in dispatcher anymore.
With that said, I will leave it as how it is for now and in case #15226, we will make this change
@joomdonation can you edit the com_content namespace files as appropriate for this change please