Sends the output to browser.
4052
public function sendOutput()
    {
        // check environment to see what and how to do the output
        $prettyPrint = false;
        if ($this->env == 'development') {
            $prettyPrint = true;
            unset($this->outputArray['debug']);
        }

        // if there is an error, we always dump the content
        if (!empty($this->outputArray['errorReport'])) {
            unset($this->outputArray['data']);
        }

        // build response
        if (empty($this->outputArray)) {
            $response = $this->httpResponse();
        } else {
            $response = new JsonResponse($this->outputArray, $this->debugHeaders, $prettyPrint);
        }

        // set proper status code to the response
        $response->setStatusCode($this->statusCode, $this->message);

        // check the expires header
        if ($this->expiresIn > 0) {
            $expiration = $this->dateTime()->add('PT' . $this->expiresIn . 'S');
            $response->cacheControl()->setAsCache($expiration);
        }

        // send it to the browser
        $response->send();
    }
847286
public function sendOutput()
    {
        if ($this->binary) {
            $rcmail = rcmail::get_instance();
            $rcmail->output->future_expire_header(10 * 60);

            header('Content-Type: ' . $this->mimetype);
            header('Content-Size: ' . strlen($this->binary));
            echo $this->binary;

            return true;
        }

        return false;
    }
865844
def _sendResult(self, result):
        
        # logger.debug("Result: %s", result)

        try:
            result = json.dumps(result)
        except Exception as error:
            result = json.dumps(self._errorInfo(command, error))

        sys.stdout.write(result)
        sys.stdout.write("\n")
        sys.stdout.flush()
902332
public function send() {
    list ($headers, $blob, $code) = $this->toHttp();
    header('Content-Type: ' . Constants::MIME_TYPE);
    header("X-PHP-Response-Code: $code", TRUE, $code);
    foreach ($headers as $n => $v) {
      header("$n: $v");
    }
    echo $blob;
  }
570894
def _output(self, s):
    """"""

    if s.lower().startswith(b'host: '):
        self._buffer.insert(1, s)
    else:
        self._buffer.append(s)
154520
public function output()
    {
        foreach ($this->headers as $name => $value) {
            header($name.': '.$value, true, $this->responseCode());
        }
        echo $this->body;
    }
344129
def _send(self, javascript):
        

        # Prepend JS to switch to the proper client context.
        message = """
            var _ctx = ctx_switch('%s'),
                browser = _ctx[0],
                ELEMENTS = _ctx[1];
            %s
        """ % (id(self), javascript)

        response = self.connection.send(message)

        return self._handle_response(response)
500786
public function send()
    {
        foreach ($this->headers as $header) {
            header($header->getString(), $header->getReplace(), $header->getHttpResponseCode());
        }
    }
1040390
function onPage(output, page) {
    var options = output.getOptions();

    // Inline assets
    return Modifiers.modifyHTML(page, [
        Modifiers.inlineAssets(options.get('root'), page.getFile().getPath())
    ])

    // Write page using website generator
    .then(function(resultPage) {
        return WebsiteGenerator.onPage(output, resultPage);
    });
}
849985
function Output(options) {
  options = options || {};
  this.command = options.command || '';
  this.args = options.args || {};
  this.typed = options.typed || '';
  this.canonical = options.canonical || '';
  this.hidden = options.hidden === true ? true : false;

  this.type = undefined;
  this.data = undefined;
  this.completed = false;
  this.error = false;
  this.start = new Date();

  this.promise = new Promise(function(resolve, reject) {
    this._resolve = resolve;
  }.bind(this));
}
404629
def _emit(self, s):
    """"""
    if os.path.exists(self._html_dir):  # Make sure we're not immediately after a clean-all.
      self._report_file.write(s)
      self._report_file.flush()
1137355
def send(self):
        

        if hasattr(self, 'request'):
            self.request.responded = True
        self.connection.writer.write(str(self).encode())
        yield from self.connection.writer.drain()
163256
public function output(): void
    {
        header('HTTP/1.1 ' . $this->getStatusCode());

        // Output headers.
        foreach ($this->getHeaders() as $headerName => $headerValue) {
            header($headerName . ': ' . $headerValue);
        }

        // Set cookies.
        foreach ($this->getCookies() as $cookieName => $cookie) {
            /** @var ResponseCookieInterface $cookie */
            setcookie(
                $cookieName,
                $cookie->getValue(),
                $cookie->getExpiry() !== null ? $cookie->getExpiry()->getTimestamp() : 0,
                $cookie->getPath() !== null ? $cookie->getPath()->__toString() : '',
                $cookie->getDomain() !== null ? $cookie->getDomain()->__toString() : '',
                $cookie->isSecure(),
                $cookie->isHttpOnly()
            );
        }

        // Output content.
        echo $this->getContent();
    }
536419
private function postRun()
    {
        if (count($this->outputTo) > 0) {
            foreach ($this->outputTo as $file) {
                $output_mode = $this->outputMode === 'append' ? FILE_APPEND | LOCK_EX : LOCK_EX;
                file_put_contents($file, $this->output, $output_mode);
            }
        }

        // Send output to email
        $this->emailOutput();

        // Call any callback defined
        if (is_callable($this->after)) {
            call_user_func($this->after, $this->output, $this->returnCode);
        }

        $this->removeLockFile();
    }
960729
@Override
    public String output() {
        String output = process.output();
        publisher.publish(new Returned(command, output));
        return output;
    }
751580
public function execute()
    {
        if (isset($_POST['ajax_submit']) || $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
            //if($this->app->jquery)$this->app->jquery->getJS($this->owner);

            if (headers_sent($file, $line)) {
                echo "<br/>Direct output (echo or print) detected on $file:$line. <a target='_blank' "
                    ."href='http://agiletoolkit.org/error/direct_output'>Use \$this->add('Text') instead</a>.<br/>";
            }

            $x = $this->app->template->get('document_ready');
            if (is_array($x)) {
                $x = implode('', $x);
            }
            echo $this->_render();
            $this->app->hook('post-js-execute');
            exit;
        } else {
            throw $this
                ->exception('js()->..->execute() must be used in response to form submission or AJAX operation only');
        }
    }
83872
function output()
  {
    header("Expires: Sun, 1 Jan 2000 12:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");

    switch($this->image_type)
    {
      case SI_IMAGE_JPEG:
        header("Content-Type: image/jpeg");
        imagejpeg($this->im, null, 90);
        break;

      case SI_IMAGE_GIF:
        header("Content-Type: image/gif");
        imagegif($this->im);
        break;

      default:
        header("Content-Type: image/png");
        imagepng($this->im);
        break;
    }

    imagedestroy($this->im);
  }