@Findus23 opened this Issue on December 9th 2020 Member

When someone wants to create a plugin and is using the Matomo version from matomo.zip, they probably get an error like this one:

Uncaught exception: Error: Class 'Piwik\Plugins\ExamplePlugin\ExamplePlugin' not found

This is expected as Matomo doesn't ship with the Example* plugins anymore, but doesn't help the person struggling with this.

Instead, the generate:plugin should detect if those plugins are missing and if not point people towards https://developer.matomo.org/guides/getting-started-part-1

@tsteur commented on December 9th 2020 Member

BTW maybe some other thought... those commands require development mode to be enabled anyway. So maybe when development mode is enabled, we could call the method whether Matomo is installed through git (SettingsPiwik::isGitDeployment) and if not, throw an error mentioning "development mode can be only enabled when installed through git"

@Findus23 commented on December 9th 2020 Member

Makes sense, I am just not sure at the moment if there isn't some reason why someone would want to enable development temporarily in production.

@tsteur commented on December 9th 2020 Member

@Findus23 there shouldn't be (did a very quick check) and if there is a reason then we would maybe need to change something or add another check like we do here: https://github.com/matomo-org/matomo/blob/4.0.5/core/FrontController.php#L641-L647

This be an easy fix and could also fix other issues and make development more like what it's meant to be used from I guess.

@tsteur commented on March 3rd 2021 Member
  • In the generate commands throw an exception if dev mode is enabled and not installed through git
  • Printing a warning when calling development:enable if it's not installed through git
  • We could also show the warning in the Matomo admin if dev mode is enabled, but not installed through git. We would maybe only show this to super users.
This Issue was closed on March 17th 2021
Powered by GitHub Issue Mirror