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

When Piwik DB needs to be upgraded, the API should return a valid response #8464

Merged
merged 1 commit into from Aug 14, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jul 30, 2015

fixes #7902

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 30, 2015
@tsteur tsteur added this to the 2.15.0 milestone Jul 30, 2015
$response = new ResponseBuilder($outputFormat);
$e = new Exception('Database Upgrade Required. Your Piwik database is out-of-date, and must be upgraded before you can continue.');
echo $response->getResponseException($e);
Common::sendResponseCode(503);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you send the http response code, before the response is echo'ed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it but seems to work anyway see test (maybe because of output buffering or so)

@mattab
Copy link
Member

mattab commented Aug 13, 2015

left a small comment, needs rebase + can be merged

Nice one!

tsteur added a commit that referenced this pull request Aug 14, 2015
When Piwik DB needs to be upgraded, the API should return a valid response
@tsteur tsteur merged commit d5373d8 into master Aug 14, 2015
@tsteur tsteur deleted the 7902 branch August 14, 2015 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants