Skip to content

Commit

Permalink
moved signal constants inside constructor to avoid notices when runni…
Browse files Browse the repository at this point in the history
…ng in webserver module
  • Loading branch information
marcelog committed May 16, 2012
1 parent 5b78eeb commit f54d8be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ You can now easily install Ding by issuing:
or


# pear install marcelog/Ding-1.6.0
just replace 1.6.0 by the release version you'd like to install :)
# pear install marcelog/Ding-1.6.1
just replace 1.6.1 by the release version you'd like to install :)
See: http://pear.marcelog.name/

Note: A version 1.2.x was erroneously released because of a misconfiguration of
Expand Down
14 changes: 5 additions & 9 deletions src/mg/Ding/Container/Impl/ContainerImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@
*/
class ContainerImpl implements IContainer
{
/**
* Signals to handle.
* @var array
*/
private $_signals = array(
SIGQUIT, SIGHUP, SIGINT, SIGCHLD, SIGTERM, SIGUSR1, SIGUSR2
);
/**
* Logger.
* @var Logger
Expand Down Expand Up @@ -1076,11 +1069,14 @@ protected function __construct(array $options)
$this->registerProperties(self::$_options['properties']);
$sapi = php_sapi_name();
if ($sapi == 'cgi' || $sapi == 'cli') {
$signals = array(
SIGQUIT, SIGHUP, SIGINT, SIGCHLD, SIGTERM, SIGUSR1, SIGUSR2
);
$handler = array($this, 'signalHandler');
foreach ($this->_signals as $signal) {
foreach ($signals as $signal) {
pcntl_signal($signal, $handler);
}
pcntl_sigprocmask(SIG_UNBLOCK, $this->_signals);
pcntl_sigprocmask(SIG_UNBLOCK, $signals);
}
set_error_handler(array($this, 'errorHandler'));
register_shutdown_function(array($this, 'shutdownHandler'));
Expand Down

0 comments on commit f54d8be

Please sign in to comment.