Skip to content
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

Calling the API in PHP: multiple issues #3921

Closed
LeCoyote opened this issue May 2, 2013 · 5 comments
Closed

Calling the API in PHP: multiple issues #3921

LeCoyote opened this issue May 2, 2013 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@LeCoyote
Copy link

LeCoyote commented May 2, 2013

There are several undocumented issues when calling the API in PHP as described here: http://piwik.org/docs/analytics-api/calling-techniques/#toc-call-the-piwik-api-in-php

  • error_reporting is overwritten: piwik.php sets it to E_ALL|E_NOTICE
  • default timezone is overwritten: piwik.php sets it to UTC

These can apparently be alleviated by NOT including index.php, so perhaps it should be clearer in the documentation (ie. a small paragraph instead of just a couple of comments in the code sample).

Besides, in both cases :

  • calling Live.getCounters in PHP returns unexpected results.
    In this one instance where the site is running in the Europe/Paris timezone, if lastMinutes < 120, the API will always return 0 visits. This is obviously because the visits are stored in UTC and the calling code is 2 hours ahead of UTC (CEST). Apparently, this bug is undocumented and should definitely be handled by the API.

Last but not least, there is ticket #2294, on which I already commented:

  • when calling the API in PHP, the only usable format is 'original'; every other format will return a header that will, in turn, mess with the calling code's output.
    I must insist that this one should be considered a bug, not a feature request.
    Keywords: API
@mattab
Copy link
Member

mattab commented May 5, 2013

I agree with lack of documentation, but really in this case best practise is for you to duplicate index.php and remove unwanted code, so you make your own custom boostrap. Our doc does not recommend this but I can recommend it. If you found a bug with Live API let us know in separate ticket.. thanks

@LeCoyote
Copy link
Author

LeCoyote commented May 6, 2013

If you acknowledge the lack of documentation, perhaps the bug should be left open until the documentation is fixed? A recommendation in a comment to a bug can hardly be considered documentation :)

And since you haven't commented on the other two issues, I'll take it they are genuine bugs. I will create a new one for the date problem and comment on #2294.

@anonymous-matomo-user
Copy link

I've been asked to look in to why PiWik has been generation notices on our site, and I find the resolution to this bug to be very perplexing.

Is there any particular reason PiWik does not respect the logging setting configured in PHP? Is there really no other way to change this other than to edit PiWik's source? If there is a reason that the default is not used, could we at least modify it from a configuration setting, instead?

@mattab
Copy link
Member

mattab commented Jul 29, 2013

If you have a patch/pull request, I will be pleased to look at it and consider it for inclusion in core. Thanks!

@AntoineWtrnd
Copy link

AntoineWtrnd commented Mar 24, 2019

Not only lack of documentation, but alot of bug and unstable software. I just don't get it how company can use this unstable software.

This is the first time i see 10 009 issues on a GitHub project and theres plenty of bigger project.

Still a shitty software in 2019.

Google Analytics do the same shit for free, stable and in the cloud. Also, there an white-label API. So, it was the last time i use Matomo.

Developer team should retake a look on the core.

It look like junior dev

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

4 participants