protected function stopServer($address, $pid = null)
    {
        $success = true;
        if ($pid && function_exists('posix_kill')) {
            /** @noinspection PhpComposerExtensionStubsInspection */
            $success = posix_kill($pid, SIGTERM);
            if (!$success) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                $this->stdErr->writeln(sprintf(
                    'Failed to kill process <error>%d</error> (POSIX error %s)',
                    $pid,
                    posix_get_last_error()
                ));
            }
        }
        $pidFile = $this->getPidFile($address);
        if (file_exists($pidFile)) {
            $success = unlink($pidFile) && $success;
        }
        unset($this->serverInfo[$address]);
        $this->saveServerInfo();

        return $success;
    }
protected function stopServer($address, $pid = null)
    {
        $success = true;
        if ($pid && function_exists('posix_kill')) {
            /** @noinspection PhpComposerExtensionStubsInspection */
            $success = posix_kill($pid, SIGTERM);
            if (!$success) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                $this->stdErr->writeln(sprintf(
                    'Failed to kill process <error>%d</error> (POSIX error %s)',
                    $pid,
                    posix_get_last_error()
                ));
            }
        }
        $pidFile = $this->getPidFile($address);
        if (file_exists($pidFile)) {
            $success = unlink($pidFile) && $success;
        }
        unset($this->serverInfo[$address]);
        $this->saveServerInfo();

        return $success;
    }
protected function stopServer ( $ address , $ pid = null ) { $ success = true ; if ( $ pid && function_exists ( 'posix_kill' ) ) { /** @noinspection PhpComposerExtensionStubsInspection */ $ success = posix_kill ( $ pid , SIGTERM ) ; if ( ! $ success ) { /** @noinspection PhpComposerExtensionStubsInspection */ $ this -> stdErr -> writeln ( sprintf ( 'Failed to kill process <error>%d</error> (POSIX error %s)' , $ pid , posix_get_last_error ( ) ) ) ; } } $ pidFile = $ this -> getPidFile ( $ address ) ; if ( file_exists ( $ pidFile ) ) { $ success = unlink ( $ pidFile ) && $ success ; } unset ( $ this -> serverInfo [ $ address ] ) ; $ this -> saveServerInfo ( ) ; return $ success ; }
Stop a running server.

@param string $address
@param int|null $pid

@return bool
True on success, false on failure.
Stop a running server .