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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added API endpoint to return the php version info #13646
Conversation
Hey @Toflar please see https://travis-ci.org/matomo-org/matomo/builds/446616865 for your tests results (not all fails are your fault (but some are), just take a look if anything looks like it could be your fault ;)) |
At least this screen is failing because of the change: https://builds-artifacts.matomo.org/matomo-org/matomo/3.x-dev/30825/UIIntegrationTest_api_listing.png |
Oh nice, UI tests using screenshots, that's cool! |
FYI: I quickly checked... the DB connection should be only needed to bootstrap the test system but the unit tests itself shouldn't connect to the DB. |
plugins/API/API.php
Outdated
*/ | ||
public function getPhpVersion() | ||
{ | ||
Piwik::checkUserHasSomeViewAccess(); |
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.
This would need to be Piwik::checkUserHasSuperUserAccess();
.
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.
Can you elaborate why? I mean, why do I need super user access to get the php version but not to get the matomo version?
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.
We're currently only exposing this information to super users. Partially for security reasons. If you needed it for View users, you could develop a simple plugin that defines this API using eg
./console generate:plugin --name="MyPlugin"
./console generate:api
You could even put the plugin on the Marketplace https://developer.matomo.org/guides/distributing-your-plugin
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.
I agree with @tsteur.
There are many ways a user with view access could find out the Matomo version without the api, but there should be non to find out the php version.
Looks good for me. Any thoughts @mattab ? |
LGTM 馃憤 |
Cheers @Toflar |
Hey everybody,
I'm using the
getMatomoVersion
endpoint to see if my Matomo setups are all up-to-date. I would like to also know if the PHP version they're all running on are maintained. Unfortunately there's no endpoint yet for that.I'm very new to the code base of Matomo but actually very experienced in php and testing. Also followed your setup guide for the tests but when trying to run
./console tests:run unit
it tried to connect to the db (which is very strange to me for unit tests) so I didn't explore more on it.Feel free to guide me to the things I need to do to have this tested, I'll happily update the PR if you like this addition 馃槃