-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Use rebranded composer components #15253
Conversation
15f8143
to
f90ee0a
Compare
309d343
to
84937a5
Compare
@diosmosis @tsteur @mattab Switching to the rebranded packages (with new namespaces) might maybe cause problems while updating, as some plugins might still use the old namespace until they are updated. |
I reckon this won't be possible since some people will update from older 3.x or 2.X to 4.1. Updating plugins first can cause issues too if anything fails there. Ideally the components would have both the new Matomo and the old Piwik classes but that might not be easily doable. Although the components typically maybe don't have too many classes so could be done maybe. Otherwise I suppose it should be fine maybe as long as the plugins don't access any component during update? They might though... also people manually updating core etc will have problems. Do we even need to update the components from Piwik to Matomo or wait until we do this also for core? |
Could this be done via inheritance? Ie:
|
I guess that should work. Should we add those classes to the packages or to Matomo itself? |
Not sure what's easier? |
I suppose we would need to make sure the autoloader still finds the files etc. |
Very crazy thought... can the auto loader do that? Recognise Piwik namespace, then look for the matomo file that includes Matomo class, then do dynamically a Not sure if we can extend classes that way dynamically... |
@tsteur I'll give it a try and implement it that way if possible |
84937a5
to
4226651
Compare
That's pretty cool 👍 |
550d7f4
to
a05b808
Compare
a05b808
to
cdab498
Compare
b8a3feb
to
e81b9a2
Compare
Should be ready for review. Remaining package is |
e81b9a2
to
1bd92e5
Compare
} | ||
} | ||
|
||
LegacyAutoloader::register(); |
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.
Maybe I missed it but could we add maybe a few basic tests that this works?
In general behaviour seems otherwise good: https://3v4l.org/TAS8d
Can we assume, that if a file containing a Matomo class was loaded manually through include/require
, then the logic would not work? (Probably not an issue but something to be aware of eg if we wanted to do that for all classes in core).
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.
No, that works as well. Added some simple tests for it. See de2fea6
1bd92e5
to
719f16d
Compare
refs #12519