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

emitter is always defined and it should stop script execution after e… #2

Merged
merged 1 commit into from
Jun 5, 2018

Conversation

DarkSide666
Copy link
Member

emitter is always defined and it should stop script execution after emitting otherwise it tries to match more services.

For example:

$restapi->get('/ping', function() {
   return 'Pong';
});

// here we authorize - check for token
$restapi->authorize();

if I request service /ping, then it also tries to authorize, but it should stop script execution as soon as /ping service is matched and response is emitted.

return $ret;
// emit response and exit
$this->emitter->emit($this->response);
exit;
Copy link
Member

Choose a reason for hiding this comment

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

there was a reason why "exit" wasn't here. I'm OK to add it for now but may need to remove in the future if i remember.

@DarkSide666 DarkSide666 merged commit 56dab00 into develop Jun 5, 2018
@DarkSide666 DarkSide666 deleted the feature/exit-after-emit branch June 5, 2018 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants