Generate the cache header

@return string
324155
protected function generateCacheHeader()
    {
        $cacheControl = [];
        foreach ($this->getDirectives() as $directive => $value) {
            if ($value === true) {
                $cacheControl[] = $directive;
            } else {
                $cacheControl[] = $directive . '=' . $value;
            }
        }
        return implode(', ', $cacheControl);
    }
498243
public function header()
    {
        if ($this->header_translated) {
            return cms_trans($this->header_translated);
        }

        if ($this->header) {
            return $this->header;
        }

        return ucfirst(str_replace('_', ' ', snake_case($this->source)));
    }
102510
private function cacheDirectory(): string
    {
        $cacheDirectory = (string) $this->cacheDirectory;

        if ('' === $cacheDirectory && false === \is_writable($cacheDirectory))
        {
            $cacheDirectory = \sys_get_temp_dir();
        }

        return \rtrim($cacheDirectory, '/');
    }
705318
public static function getModifiedSinceHeader()
    {
        $modifiedSince = '';
        if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
            $modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];

            // strip any trailing data appended to header
            if (false !== ($semicolonPos = strpos($modifiedSince, ';'))) {
                $modifiedSince = substr($modifiedSince, 0, $semicolonPos);
            }
        }
        return $modifiedSince;
    }
1067153
public function createHeader(): string
    {
        $header = [rawurlencode($this->name) . '=' . rawurlencode((string)$this->value)];

        if ($this->lifetime !== null) {
            $header[] = 'Expires=' . gmdate(\DateTime::COOKIE, $this->getExpires());
            $header[] = 'Max-Age=' . $this->lifetime;
        }

        if (!empty($this->path)) {
            $header[] = 'Path=' . $this->path;
        }

        if (!empty($this->domain)) {
            $header[] = 'Domain=' . $this->domain;
        }

        if ($this->secure) {
            $header[] = 'Secure';
        }

        if ($this->httpOnly) {
            $header[] = 'HttpOnly';
        }

        return join('; ', $header);
    }
107931
public function getHeaders()
    {
        $h = array();
        if (!empty($this->timeout))
            $h['Refresh'] = $this->timeout . '; url=' . $this->url;
        else
            $h['Location'] = (string)$this->url;
        return $h;
    }
405264
public function generateHash(): string
    {
        $h = sprintf('%s%s%s', (string)$this->getIdentificator(), $this->getExpiration(), $this->getSecret());
        $h = md5($h, true);
        $h = self::base64url_encode($h);
        return $h;
    }
1338065
public function generateCacheKey(): string
    {
        $name = $this->getConnection()->getName();

        return \md5($name.$this->toSql().\serialize($this->getBindings()));
    }
260108
private function getHeaders()
    {
        $result = [];
        foreach ($this->headers as $name => $value) {
            $result[] = sprintf("%s: %s", $name, $value);
        }

        return $result;
    }
942114
public function getHeader()
    {
        $this->withHeader = true;
        if (ftell($this->handle) == 0) {
            $this->header = $this->read();
        }
        return $this->header;
    }
975290
protected function getCacheFilePath()
    {
        $hash = md5($this->filePath);
        $result = storage_path().'/cms/cache/';
        $result .= substr($hash, 0, 2).'/';
        $result .= substr($hash, 2, 2).'/';
        $result .= basename($this->filePath);
        $result .= '.php';

        return $result;
    }
311265
protected function getHeader()
    {
        $header = '';

        $fin  = $this->fin  ? 0x80 : 0x00;

        $rsv1 = $this->rsv1 ? 0x40 : 0x00;
        $rsv2 = $this->rsv2 ? 0x20 : 0x00;
        $rsv3 = $this->rsv3 ? 0x10 : 0x00;

        $byte1 = $fin | $rsv1 | $rsv2 | $rsv3 | $this->opcode;

        $mask = $this->isMasked ? 0x80 : 0x00;

        $byte2 = $mask | $this->length;

        $header .= pack('CC', $byte1, $byte2);

        if ($this->length === 0x7e) {
            $header .= pack('s', $this->length16);
        }

        if ($this->length === 0x7f) {
            // TODO
        }

        if ($this->isMasked) {
            $header .= $this->mask;
        }

        return $header;
    }
639552
public function getCacheTag()
    {
        return $this->cacheTagPrefix .
            ($this->isAttributeChanged($this->idAttribute) ? $this->getOldAttribute($this->idAttribute) : $this->getID());
    }
680112
public function getHeader()
    {
        switch ($this->type) {
            case self::TYPE_ERROR:
                $header = 'Error!';
                break;
            case self::TYPE_WARNING:
                $header = 'Warning!';
                break;
            case self::TYPE_INFO:
                $header = 'Info';
                break;
            case self::TYPE_SUCCESS:
                $header = 'Success';
                break;
            default:
                $header = 'Info';
                break;
        }

        return $header;
    }
1024808
public static function getAllRequestHeaders() {
        static $_cached_headers = false;
        if($_cached_headers!==false) {
            return $_cached_headers;
        }
        $headers = array();
        if(function_exists('getallheaders')) {
            foreach( getallheaders() as $name => $value ) {
                $headers[strtolower($name)] = $value;
            }
        } else {
            foreach($_SERVER as $name => $value) {
                if(substr($name, 0, 5) == 'HTTP_') {
                    $headers[strtolower(str_replace(' ', '-', str_replace('_', ' ', substr($name, 5))))] = $value;
                }
            }
        }
        return $_cached_headers = $headers;
    }
477584
protected function _getHeader()
    {
        $header = [];
        foreach ($this->_grid->getColumns() as $column) {
            if ($column instanceof Column\IndexColumn || $column instanceof Column\OperationColumn) {
                continue;
            }
            if ($column instanceof Column\CustomColumn && !$column->getExporting()) {
                continue;
            }
            $header[] = $column->getLabel();
        }
        return $header;
    }
689905
private function createHeader()
    {
        $headers = $this->headers;

        $username = $this->getUsername();
        $auth_type = $this->getAuthType();

        if ('hash' == $auth_type) {
            $headers['Authorization'] = 'WHM ' . $username . ':' . preg_replace("'(\r|\n|\s|\t)'", '', $this->getPassword());
        } elseif ('password' == $auth_type) {
            $headers['Authorization'] = 'Basic ' . base64_encode($username . ':' .$this->getPassword());
        }
        return $headers;
    }