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 PSR-4 for autoloader #4074
Comments
Any thoughts on renaming "core/" to "core/Piwik", and "plugins" to "plugins/Piwik/Plugin"? Then the codebase would be PSR0 compliant and we could use something like this in composer.json:
and eliminate core/Loader.php altogether. |
@vipsoft: Great idea! As an alternative we could also just combine core/plugins into a single src/ folder. This would avoid having a rather redundant "plugins/Piwik/Plugins". We would then have "src/Piwik" and "src/Piwik/Plugins"
With composer we already have a PSR-0 compatible autoloader and can get rid of the unnecessary core/Loader.php. |
I would prefer keeping core/ and plugins/ rather than adding one more level... I'll simplify the Loader.php as a result (rather than use composer autoloader) |
This basically means we will not be PSR-0/1/2 compliant. Having the above directory structure is required by PSR-0 and PSR-1/2 require PSR-0 compliancy. Any option to discuss this matter? |
With the breaking changes of a major version bump, I think this would be the opportune time for PSR-0 compliance. (And PSR-2 depends on PSR-1 which depends on PSR-0.) Let's ask the team to weigh in. Caveat: there are still manual include/require but definitely doable. (For the record, I'm in favor of using the composer autoloader for the tracker as well.) |
Issue should be closed since we now use Composer autoloader in #6024 Nice work @diosmosis |
…annot be disabled, so no need to check for spl. Do not throw an exception in first autoloader if class does not exist, this should give the second autoloader a change to load the class.
… try to load it directly from there and do not look in other folders first. Unfortunately we still need the other logic for backwards compatibility
Why include file manually? because piwik.php does not use autoloader yet. Maybe as part of refs matomo-org#4074 we could setup autoloader for piwik.php / tracking API.
Todo post #4059
The text was updated successfully, but these errors were encountered: