Page-not-found handler for use in frontend plugins from extensions.

@param string $reason Reason text
@param string $header HTTP header to send
@throws DocumentPreparationException
428413
public function pageNotFoundAndExit($reason = '', $header = '')
    {
        if (!defined('EXT_SOLR_INDEXING_CONTEXT')) {
            parent::pageNotFoundAndExit($reason, $header);
        }
        throw new DocumentPreparationException('Solr Document can not be prepared. The Reason: ' . $reason, 1517584045);
    }
1281340
public function setReason($reason)
    {
        if ($this->dispatched) {
            throw new \RuntimeException('Attempting to set reason after dispatch.');
        }
        $this->reason = $reason;
        $this->dispatched = true;

        return $this;
    }
539586
public void document_cors_POST(String origin) throws IOException {
		String qPath = "/store/document/cors";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "origin", origin);
		exec(qPath, "POST", sb.toString(), o);
	}
32518
protected function _processRoute(Context $c, $handler, &$response)
  {
    if($handler === null)
    {
      throw new \RuntimeException(ConditionHandler::ERROR_NO_HANDLER, 500);
    }
    throw new \RuntimeException(self::ERROR_NO_ROUTE, 404);
  }
510797
private function setHeaderCharset(Swift_Mime_Header $header)
    {
        if (isset($this->charset)) {
            $header->setCharset($this->charset);
        }
    }
865070
public function fileNotFound()
    {
        try {
            $this->header('404 Not Found');
            $this->header('Content-Type: text/html');
        } catch (\PHPDaemon\Request\RequestHeadersAlreadySent $e) {
        }
        $this->out('File not found.');
    }
21484
public void setHeader(HeaderFooter header) {
        this.header = header;
        DocListener listener;
		for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
            listener = (DocListener) iterator.next();
            listener.setHeader(header);
        }
    }
1010385
public function setHeader($header = null)
    {
        if (is_null($header) && $this->getMethod() == "POST") {
            $host = $this->getHost();

            $header = [];
            $header[] = 'POST /cgi-bin/webscr HTTP/1.1';
            $header[] = 'Content-Type: application/x-www-form-urlencoded';
            if (isset($host)) {
                $header[] = 'Host: ' . $host;
            }
            $header[] = 'Connection: close';
        }
        $this->_aHeader = $header;
    }
213393
public function findByRequest(Request $request): ?PageInterface
    {
        if (null !== $route = $request->attributes->get('_route', null)) {
            return $this->findByRoute($route);
        }

        return null;
    }
1115087
protected function sendRawHeader($header)
    {
        $this->unitTest ? ($this->sentHeaders[] = $header) : header($header, false);
    }
568964
public static function getHeader($header) {

		$headers = static :: getHeaders();

		if(true === isset($headers[$header])) {
			return $headers[$header];
		}

		return null;
	}
354650
public function setAcceptHeader(string $header)
    {
        if (Validation::isValidAcceptType($header)) {
            $this->acceptHeader = $header;
        } else {
            throw new CustomException('Invalid accept type');
        }
    }
1043014
private function parseHttp($header) {
        list($version,$code,$message) = explode(" ", $header);
        
        $versionParts = explode("/",$version);
        $this->version = end($versionParts);
        $this->code = $code;
        $this->message = $message;
    }
592848
public function setContentLanguageHeader(string $header)
    {
        if (Validation::isValidContentLanguage($header)) {
            $this->contentLanguageHeader = $header;
        } else {
            throw new CustomException('Invalid language');
        }
    }
1231426
function delete(string $reason = '') {
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($reason) {
            $this->client->apimanager()->endpoints->invite->deleteInvite($this->code, $reason)->done(function () use ($resolve) {
                $resolve();
            }, $reject);
        }));
    }
1063121
public static function create($content, $jsonOption = 0, $status = 200, $reason = '', array $headers = [])
    {
        return new static($content, $jsonOption, $status, $reason, $headers);
    }
1308711
public function findHeaderIndex($header)
    {
        $xpath = $this->findHeader($header)->getXpath().'/preceding::*';

        return count($this->getPage()->findAll('xpath', $xpath)) + 1;
    }