Should Whoops push output directly to the client?
If this is false, output will be returned by handleException
@param  bool|int $send
@return bool
546029
public function writeToOutput($send = null)
    {
        if (func_num_args() == 0) {
            return $this->sendOutput;
        }

        return $this->sendOutput = (bool) $send;
    }
436174
public function headerSent(string &$file = null, int &$line = null) : bool
    {
        return headers_sent($file, $line);
    }
756770
public function send() {
    if (!isset($this->files[$this->sent])) {
      return FALSE;
    }

    $file = $this->files[$this->sent];

    // Local header
    $local = $file->genLocal(self::ZIP_VERSION, $this->dosStamp);
    $this->output($local);

    // Body
    $file->hasDeflation() ? $this->outputDeflated($file) : $this->outputRaw($file);

    // Data descriptor
    $dataDescriptor = $file->isSmooth() ? $file->genDataDescriptor() : '';
    $this->output($dataDescriptor);

    $file->setLocalOffset($this->localOffset);
    $this->localOffset += strlen($local) + $file->getDeflatedSize() + strlen($dataDescriptor);

    // Central header (not output, see flush)
    $file->genCentral(self::ZIP_VERSION, $this->dosStamp);
    $this->centralLength += strlen($file->getCentral());

    $this->sent++;
    return TRUE;
  }
522321
public function sendTo(int $receiver, string $data, int $sender = -1): int
    {
        $finish = true;
        $opcode = 1;
        $fromUser = $sender < 0 ? 'SYSTEM' : $sender;

        $this->log("(private)The #{$fromUser} send message to the user #{$receiver}. Data: {$data}");

        return $this->server->push($receiver, $data, $opcode, $finish) ? 1 : 0;
    }
1224160
public static function sendHeader($header, $replace = true)
    {
        // don't send header in CLI mode
        if (!Common::isPhpCliMode() and !headers_sent()) {
            header($header, $replace);
        }
    }
110709
protected function whoops()
    {
        $whoops = new Whoops();
        $whoops->allowQuit(false);
        $whoops->writeToOutput(false);
        $whoops->pushHandler(new Handler());

        return $whoops;
    }
1055770
public function send( $headers = false ) 
	{
		if ( $headers && headers_sent() && !CLI ) 
		{
			throw new CCException( "CCResponse::send - cannot send header, header has already been send." );
		}

		if ( $headers ) 
		{
			// status header
			header( CCIn::server( 'SERVER_PROTOCOL' ).' '.$this->_status.' '.CCResponse::$messages[$this->_status] );

			// check if content type is already set
			if ( !isset( $this->_header['Content-Type'] ) ) 
			{
				$this->header( 'Content-Type', 'text/html; charset='.ClanCats::$config->get( 'charset', 'utf-8' ) );
			}

			$this->header( 'X-Powered-By', 'ClanCatsFramework version: '.ClanCats::VERSION );

			// set headers
			foreach( $this->_header as $key => $content ) 
			{
				header( $key.': '.$content );
			}
		}

		// profiler
		CCProfiler::check( 'CCResponse - sending response' );

		// print the body
		echo CCEvent::pass( 'response.output', $this->body() );
	}
1143632
public function curl_before_send(&$handle) {
		curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
		curl_setopt($handle, CURLOPT_USERPWD, $this->getAuthString());
	}
87164
private function writeToOutputNow($output)
    {
        if ($this->sendHttpCode() && \Whoops\Util\Misc::canSendHeaders()) {
            $this->system->setHttpResponseCode(
                $this->sendHttpCode()
            );
        }

        echo $output;

        return $this;
    }
1338461
protected function mail($from)
        {
            if (!$this->state['helo']) {
                throw new Exception('Need HELO before MAIL FROM');
            }
            // issue MAIL FROM, 5 minute timeout
            $this->send('MAIL FROM:<' . $from . '>');
            try {
                $this->expect(self::SMTP_GENERIC_SUCCESS, $this->command_timeouts['mail']);
                // set state flags
                $this->state['mail'] = true;
                $this->state['rcpt'] = false;
                return true;
            } catch (Exception $e) {
                // got something unexpected in response to MAIL FROM
                $this->debug("Unexpected response to MAIL FROM\n:" . $e->getMessage());
                // hotmail is know to do this, and is closing the connection
                // forcibly on their end, so I'm killing the socket here too
                $this->disconnect(false);
                return false;
            }
        }
873370
public function setHandler($output)
	{
		$this->_whoops->popHandler();

		if ($output == OutputData::Json)
		{
			$this->_handler = new JsonResponseHandler();
		}
		else if ($output == OutputData::Xml)
		{
			$this->_handler = new XmlResponseHandler();
		}
		else
		{
			$this->_handler = new PrettyPageHandler();
			if (!Context::getInstance()->getDevelopmentStatus())
			{
				$this->_handler->addResourcePath(\WhoopsResources\Resource::getPath());
			}
		}

		$this->_whoops->pushHandler($this->_handler);
	}
413033
public function send()
    {
        if (!static::isSent()) {
            static::call('send', $this);
            foreach ($this->headers as $header => $value) {
                $this->setHttpHeader($header, $value);
            }
            http_response_code($this->status);
            echo $this->body;
            static::$sent = true;
            return true;
        }
        return false;
    }
29003
function _close_handle($handle)
    {
        if (!$this->_send_sftp_packet(NET_SFTP_CLOSE, pack('Na*', strlen($handle), $handle))) {
            return false;
        }

        // "The client MUST release all resources associated with the handle regardless of the status."
        //  -- http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.1.3
        $response = $this->_get_sftp_packet();
        if ($this->packet_type != NET_SFTP_STATUS) {
            user_error('Expected SSH_FXP_STATUS');
            return false;
        }

        if (strlen($response) < 4) {
            return false;
        }
        extract(unpack('Nstatus', $this->_string_shift($response, 4)));
        if ($status != NET_SFTP_STATUS_OK) {
            $this->_logError($response, $status);
            return false;
        }

        return true;
    }
539093
protected synchronized void do_send(final OtpOutputStream header,
            final OtpOutputStream payload) throws IOException {
        try {
            if (traceLevel >= sendThreshold) {
                // Need to decode header and output buffer to show trace
                // message!
                // First make OtpInputStream, then decode.
                try {
                    final OtpErlangObject h = header.getOtpInputStream(5)
                            .read_any();
                    System.out.println("-> " + headerType(h) + " " + h);

                    OtpErlangObject o = payload.getOtpInputStream(0).read_any();
                    System.out.println("   " + o);
                    o = null;
                } catch (final OtpErlangDecodeException e) {
                    System.out.println("   " + "can't decode output buffer:"
                            + e);
                }
            }

            // group flush op in favour of possible ssh-tunneled stream
            OutputStream out = socket.getOutputStream();
            header.writeTo(out);
            payload.writeTo(out);
            out.flush();
        } catch (final IOException e) {
            close();
            throw e;
        }
    }
65042
public function send($protocol = null)
    {
        // Clean up any open buffers
        if (ob_get_length() > 0) {
            ob_end_clean();
        }

        // Send the status code and headers
        if (!headers_sent())
            $this->sendStatus($protocol)->sendHeaders();

        // Send the body
        echo $this->_body;

        // Kill the script
        exit;

    }
709346
public function requestOut($req, $s)
    {
        if ($this->write($s) === false) {
            $req->abort();
            return false;
        }
        return true;
    }
1021080
public function send($output, OutputStrategyInterface $outputStrategy = null)
    {
        if (!($outputStrategy instanceof OutputStrategyInterface)) {
            $outputStrategy = $this->defaultOutputStrategy;
        }

        $contentType = new Header(
            Header::CONTENT_TYPE,
            $outputStrategy->getMime()
        );

        $this->header($contentType);

        return $outputStrategy->send($output);
    }