Create a default header entry

@return void
553925
public function buildDefaultHeader(): void
    {
        $this->set(PoTokens::MESSAGE, "");
        $this->set(PoTokens::TRANSLATOR_COMMENTS, 'SOME DESCRIPTIVE TITLE');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'Copyright (C) YEAR HOLDER');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'LICENSE');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, '');
        $this->set(PoTokens::FLAG, 'fuzzy');
        $this->setHeader('Project-Id-Version', 'PACKAGE VERSION');
        $this->setHeader('Report-Msgid-Bugs-To', 'FULL NAME <EMAIL@ADDRESS>');
        $this->setCreateDate();
        $this->setHeader('PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE');
        $this->setHeader('Last-Translator', 'FULL NAME <EMAIL@ADDRESS>');
        $this->setHeader('Language-Team', 'LANGUAGE <EMAIL@ADDRESS>');
        $this->setHeader('MIME-Version', '1.0');
        $this->setHeader('Content-Type', 'text/plain; charset=UTF-8');
        $this->setHeader('Content-Transfer-Encoding', '8bit');
        $this->setHeader('Plural-Forms', 'nplurals=INTEGER; plural=EXPRESSION;');
        $this->setHeader('X-Generator', 'geekwright/po');
    }
116545
protected function iniciaHeaderLote()
    {
        $this->iRegistrosLote = 0;
        $this->aRegistros[self::HEADER_LOTE] = array_fill(0, $this->tamanho_linha, ' ');
        $this->atual = &$this->aRegistros[self::HEADER_LOTE];
    }
1249018
public function addHeader() {
        $height = $this->getRowHeight();
        $definition = $this->rowDefinition;

        $this->copyDefaultColumnDefinitions(null);
        if ($this->trigger(self::EV_HEADER_ADD) !== false) {
            foreach ($this->columnDefinition as $key => $def) {
                $this->addCell($key, $def['header'], $this->columnDefinition, true);
            }
            $this->trigger(self::EV_HEADER_ADDED);
        }
        // reset row definition, because headers also copy their own column
        // definition and override the data row definition already done before
        // this method is called
        $this->setRowHeight($height);
        $this->rowDefinition = $definition;
        return $this;
    }
7385
private function write_header()
    {
        $this->write(DataIO::magic());
        $this->datum_writer->write_data(DataIO::metadata_schema(),
            $this->metadata, $this->encoder);
        $this->write($this->sync_marker);
    }
1362341
public function setDefaultStyles()
    {
        Report::setDefaultStyles();

        // Default column headers to underlined if not specified
        if (!$this->query->output_header_styles) {
            $this->query->output_header_styles["border-style"] = "solid";
            $this->query->output_header_styles["border-width"] = "0 0 1 0";
            $this->query->output_header_styles["border-color"] = array(0, 0, 0);
        }

        if (!$this->query->output_before_form_row_styles) {
            $this->query->output_before_form_row_styles["border-style"] = "solid";
            $this->query->output_before_form_row_styles["border-width"] = "0 0 0 0";
            $this->query->output_before_form_row_styles["border-color"] = array(0, 0, 0);
        }

        if (!$this->query->output_after_form_row_styles) {
            $this->query->output_after_form_row_styles["border-style"] = "solid";
            $this->query->output_after_form_row_styles["border-width"] = "1 0 0 0";
            $this->query->output_after_form_row_styles["border-color"] = array(0, 0, 0);
        }

        if (!$this->query->output_group_trailer_styles) {
            $this->query->output_group_trailer_styles["border-style"] = "solid";
            $this->query->output_group_trailer_styles["border-width"] = "1 0 1 0";
            $this->query->output_group_trailer_styles["border-color"] = array(0, 0, 0);
        }

        // Turn off page header and body background as its too complicated for now
        if (isset($this->query->output_reportbody_styles["background-color"])) {
            unset($this->query->output_reportbody_styles["background-color"]);
        }

        if (isset($this->query->output_page_styles["background-color"])) {
            unset($this->query->output_page_styles["background-color"]);
        }

    }
492488
public function addHeader(string $header, $value): self
    {
        $this->header->set($header, $value, false);

        return $this;
    }
453583
public function defaultAction(): void
    {
        $rootUrl = Http::current() . '/' . $this->view->getLanguage()->getAppliedLang();
        $this->view->header(http::redirect($rootUrl));
    }
1266422
public function showHeader()
    {
        $properties = $this->getProperties();
        $properties['header'] = true;
        $this->setProperties($properties);
        return $this;
    }
400798
private function prepareDefaultHeaders()
    {
        // Set a default content-disposition header if one was no provided
        if (!$this->hasHeader('Content-Disposition')) {
            $this->headers['Content-Disposition'] = sprintf(
                'form-data; name="%s"; filename="%s"',
                $this->name,
                basename($this->filename)
            );
        }

        // Set a default Content-Type if one was not supplied
        if (!$this->hasHeader('Content-Type')) {
            $this->headers['Content-Type'] = Mimetypes::getInstance()
                ->fromFilename($this->filename) ?: 'text/plain';
        }
    }
250938
protected function firstHeader($key, array $headers, $default = null)
    {
        if ( ! isset($headers[$key])) {
            return $default;
        }

        return is_array($headers[$key])
            ? reset($headers[$key])
            : $headers[$key];
    }
1125805
protected function _setHeader($header, $value)
    {
        $normalized = strtolower($header);
        $this->headerNames[$normalized] = $header;
        $this->headers[$header] = [$value];
    }
758672
private function prepare_auth_header() {
    $this->headers = array();
    uksort($this->auth_params, 'strcmp');
    if (!$this->config['as_header']) :
      $this->request_params = array_merge($this->request_params, $this->auth_params);
      return;
    endif;

    foreach ($this->auth_params as $k => $v) {
      $kv[] = "{$k}=\"{$v}\"";
    }
    $this->auth_header = 'OAuth ' . implode(', ', $kv);
    $this->headers['Authorization'] = $this->auth_header;
  }
563425
public function header($name, $default = null)
    {
        $header = $this->headers[strtolower($name)] ?? null;

        return $header ? $header->value() : $default;
    }
145855
protected function set_defaults()
	{
		parent::set_defaults();
		$this->headers = array();

		if ( ! empty($this->preserve_resource))
		{
			$this->resource = $this->preserve_resource;
			$this->preserve_resource = null;
		}

		return $this;
	}
648417
private function buildHeader(){

        $formClass = $this->getClassName('str');
        $formName = $this->formName;
        $formNs = $this->formNs;

        $action = $this->action;
        $method = $this->method;
        $enctype = $this->enctype;
        $header = "<form action='".$action."' method='".$method."' class='".$formNs.$formClass."' id='".$formNs.$formName."' name='".$formNs.$formName."' enctype='".$enctype."'>";

        return $header;
    }
104620
private function genericDefaultHeaders()
    {

        //Cache-Control: no-cache
        $this->addRawHeaderLine('Cache-Control', 'no-cache');

        //Pragma: no-cache
        $this->addRawHeaderLine('Pragma', 'no-cache');

        //Connection: keep-alive
        $this->addRawHeaderLine('Connection', 'keep-alive');

        //Upgrade-Insecure-Requests: 1
        $this->addRawHeaderLine('Upgrade-Insecure-Requests', '1');

        //User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
        $this->addRawHeaderLine('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36');

        //Accept-Encoding: gzip, deflate Only support the 2 types
        $this->addRawHeaderLine('Accept-Encoding', ['gzip', 'deflate']);

        //Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
        $this->addRawHeaderLine('Accept-Language', ['zh-CN', 'zh;q=0.8', 'zh-TW;q=0.7', 'zh-HK;q=0.5', 'en-US;q=0.3', 'en;q=0.2']);

    }
114905
protected function addHeaders()
    {
        $userHeaders = array_map(function ($key, $value) {
            // format header like this 'x-header: value'
            return sprintf('%s: %s', $key, $value);
        }, array_keys($this->payload['headers']), $this->payload['headers']);

        $headers = array_merge($this->defaultHeaders, $userHeaders);

        $this->addCurlOption(CURLOPT_HTTPHEADER, $headers);
    }