public function signal_handler_sighup($signal_number)
	{
		if (self::$parent_pid == getmypid())
		{
			// parent received sighup
			$this->log('parent process [' . getmypid() . '] received sighup', self::LOG_LEVEL_DEBUG);

			// call parent's sighup registered callback
			$this->invoke_callback($this->parent_function_sighup, array(), true);

			// if cascading, send sighup to all child processes
			if ($this->parent_function_sighup_cascade === true)
			{
				foreach ($this->forked_children as $pid => $pid_info)
				{
					if ($pid_info['status'] == self::STOPPED)
					{
						continue;
					}
					$this->safe_kill($pid, SIGHUP, 'parent process [' . getmypid() . '] sending sighup to child ' . $pid, self::LOG_LEVEL_DEBUG);
				}
			}
		}
		else
		{
			// child received sighup. note a child is only in one bucket, do not loop through all buckets
			if (isset($this->child_bucket) && isset($this->child_function_sighup[$this->child_bucket]))
			{
				$this->log('child process [' . getmypid() . '] received sighup with bucket type [' . $this->child_bucket . ']', self::LOG_LEVEL_DEBUG);
				$this->invoke_callback(
					$this->child_function_sighup[$this->child_bucket],
					array($this->child_bucket),
					true
				);
			}
		}
	}
public function signal_handler_sighup($signal_number)
	{
		if (self::$parent_pid == getmypid())
		{
			// parent received sighup
			$this->log('parent process [' . getmypid() . '] received sighup', self::LOG_LEVEL_DEBUG);

			// call parent's sighup registered callback
			$this->invoke_callback($this->parent_function_sighup, array(), true);

			// if cascading, send sighup to all child processes
			if ($this->parent_function_sighup_cascade === true)
			{
				foreach ($this->forked_children as $pid => $pid_info)
				{
					if ($pid_info['status'] == self::STOPPED)
					{
						continue;
					}
					$this->safe_kill($pid, SIGHUP, 'parent process [' . getmypid() . '] sending sighup to child ' . $pid, self::LOG_LEVEL_DEBUG);
				}
			}
		}
		else
		{
			// child received sighup. note a child is only in one bucket, do not loop through all buckets
			if (isset($this->child_bucket) && isset($this->child_function_sighup[$this->child_bucket]))
			{
				$this->log('child process [' . getmypid() . '] received sighup with bucket type [' . $this->child_bucket . ']', self::LOG_LEVEL_DEBUG);
				$this->invoke_callback(
					$this->child_function_sighup[$this->child_bucket],
					array($this->child_bucket),
					true
				);
			}
		}
	}
public function signal_handler_sighup ( $ signal_number ) { if ( self :: $ parent_pid == getmypid ( ) ) { // parent received sighup $ this -> log ( 'parent process [' . getmypid ( ) . '] received sighup' , self :: LOG_LEVEL_DEBUG ) ; // call parent's sighup registered callback $ this -> invoke_callback ( $ this -> parent_function_sighup , array ( ) , true ) ; // if cascading, send sighup to all child processes if ( $ this -> parent_function_sighup_cascade === true ) { foreach ( $ this -> forked_children as $ pid => $ pid_info ) { if ( $ pid_info [ 'status' ] == self :: STOPPED ) { continue ; } $ this -> safe_kill ( $ pid , SIGHUP , 'parent process [' . getmypid ( ) . '] sending sighup to child ' . $ pid , self :: LOG_LEVEL_DEBUG ) ; } } } else { // child received sighup. note a child is only in one bucket, do not loop through all buckets if ( isset ( $ this -> child_bucket ) && isset ( $ this -> child_function_sighup [ $ this -> child_bucket ] ) ) { $ this -> log ( 'child process [' . getmypid ( ) . '] received sighup with bucket type [' . $ this -> child_bucket . ']' , self :: LOG_LEVEL_DEBUG ) ; $ this -> invoke_callback ( $ this -> child_function_sighup [ $ this -> child_bucket ] , array ( $ this -> child_bucket ) , true ) ; } } }
Handle both parent and child registered sighup callbacks.

@param int $signal_number Is the signal that called this function. (should be '1' for SIGHUP).
@return void
@access public
@SuppressWarnings(PHPMD.UnusedFormalParameter) $signal_number is passed into all signal handlers.
Handle both parent and child registered sighup callbacks .