Move the PHP classes from the DCA files into separate files #7649
Comments
Is there a short-time need to change that? In Isotope we switched to a |
I don't think a BC break is necessary here. Let's just move the PHP classes to where they should have been from the beginning; it's an easy pick and it will give people the opportunity to get used to a new way of doing things, which we might enforce in a future Contao version. |
I really disagree, because the new way should be to write PSR-0/4 classes in a namespace with CamelCase names, no dependency on a Backend class etc. Adding a |
No, that's actually the new Contao 4 way. The "new thing" I was referring to is simply not to put PHP classes into DCA files :) We have agreed to fix this in on of our last calls, so the question is actually now "if" but "how". |
@leofeyer I like the idea. Just a question: will those files/classes be cached? Cause now they are cached or am I wrong? |
We have discussed not to change this in Contao 3. Still we should get rid of the classes in DCA files, but we need to check how that can be backwards compatible. |
If we waited for Contao 5, we could break backwards compatibility. |
True, or we use |
And this is not possible?
|
Yes, it would be possible. And backwards compatible. |
@aschempp What about @BugBuster1701's proposal? Do we want to change it this way? |
👍 for @BugBuster1701s solution |
I'm clearly 👎 on this. The only advantage this generates is that the internal cache file for the DCA gets smaller and to me this is simply waisted time and effort. Better invest that time on converting callbacks to events and have real PSR-0/4 paths for the listeners in a future version. |
I'm with @Toflar here, it makes no sense to change something to a still-incorrect solution (because not using PSR-0/1/2/4). It's old stuff that should be fixed later once and for all. The only good we could do is add a statement to each class saying people should not follow this bad example… |
I dislike @BugBuster1701 solution because when I read |
Ok. |
What's the best way to accomplish this? My idea is to create a new subfolder called
dcac
(the additional "c" means "classes" or "callbacks") and to store the classes prefixed withDca
in it.@contao/developers What do you think?
The text was updated successfully, but these errors were encountered: