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

do not call exit/die in core/Tracker.php #6489

Closed
diosmosis opened this issue Oct 21, 2014 · 7 comments
Closed

do not call exit/die in core/Tracker.php #6489

diosmosis opened this issue Oct 21, 2014 · 7 comments
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@diosmosis
Copy link
Member

For better testability and so we don't have to use HTTP requests to test the tracker, exit & die should not be called from within core/Tracker.php. These calls should be moved to users of core/Tracker.php, which I believe is just core/piwik.php.

@mnapoli
Copy link
Contributor

mnapoli commented Oct 21, 2014

👍

@tsteur
Copy link
Member

tsteur commented Oct 21, 2014

FYI: Without having a look we might still have to call exit in case of a redirect or at least make sure the script ends after setting the location header. Otherwise 👍

@diosmosis
Copy link
Member Author

@tsteur I think in such case we can throw an exception and catch in piwik.php?

@tsteur
Copy link
Member

tsteur commented Oct 21, 2014

Not sure if such a good idea. Just had a look it uses Url::redirectToUrl() anyway so there is no need to exit in Tracker.php anyway.

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Nov 3, 2014
@mattab mattab added this to the Short term milestone Nov 3, 2014
@mattab mattab modified the milestones: Piwik 2.10.0 , Short term Dec 1, 2014
@mattab
Copy link
Member

mattab commented Dec 1, 2014

This will likely be fixed as part of refactoring in #6075

@tsteur
Copy link
Member

tsteur commented Dec 1, 2014

Yes, there should be no exit anymore apart from redirectToUrl which triggers an exception on cli (phpunit)

@mattab
Copy link
Member

mattab commented Dec 2, 2014

👍

@mattab mattab closed this as completed Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

4 participants