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
Milestone

Comments

@diosmosis
Copy link
Member

@diosmosis diosmosis commented Oct 21, 2014

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

This comment has been minimized.

Copy link
Contributor

@mnapoli mnapoli commented Oct 21, 2014

👍

@tsteur

This comment has been minimized.

Copy link
Member

@tsteur 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

This comment has been minimized.

Copy link
Member Author

@diosmosis diosmosis commented Oct 21, 2014

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

@tsteur

This comment has been minimized.

Copy link
Member

@tsteur 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 label Nov 3, 2014
@mattab

This comment has been minimized.

Copy link
Member

@mattab mattab commented Dec 1, 2014

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

@tsteur

This comment has been minimized.

Copy link
Member

@tsteur tsteur commented Dec 1, 2014

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

@mattab

This comment has been minimized.

Copy link
Member

@mattab mattab commented Dec 2, 2014

👍

@mattab mattab closed this Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.