-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Provide method to register async shutdown function #613
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,9 +269,8 @@ public function install() | |
$this->error_handler->registerErrorHandler(); | ||
$this->error_handler->registerShutdownFunction(); | ||
|
||
if ($this->_curl_handler) { | ||
$this->_curl_handler->registerShutdownFunction(); | ||
} | ||
// Register final shutdown function to send fatal error via curl async. | ||
$this->registerShutdownFunction(); | ||
|
||
return $this; | ||
} | ||
|
@@ -742,12 +741,10 @@ protected function registerDefaultBreadcrumbHandlers() | |
$handler->install(); | ||
} | ||
|
||
protected function registerShutdownFunction() | ||
public function registerShutdownFunction() | ||
{ | ||
if (!$this->_shutdown_function_has_been_set) { | ||
$this->_shutdown_function_has_been_set = true; | ||
register_shutdown_function(array($this, 'onShutdown')); | ||
} | ||
$this->_shutdown_function_has_been_set = true; | ||
register_shutdown_function(array($this, 'onShutdown')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When using curl async, we need to register the shutdown function a second time, so that it runs after the fatal error handler. |
||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the if here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary, but the idea here was that this would be the suggested way to register shutdown function - given that _curl_handler is protected, this line is useful for anyone who is writing custom code and wants to reproduce the functionality of the install() method.