src/Response.php
protected function _sendHeadersToPhp(array $headers, $replace)
    {
        if (Base::getHttp()->headersSent())
        {
            return $this;
        }

        foreach ($headers as $key => $line)
        {
            Base::getLog()->debug(__METHOD__ . ' send headers to php', [
                'key'   => $key,
                'value' => $line,
            ]);
            if ($key == 'Set-Cookie' && is_array($line))
            {
                Base::getLog()->debug(__METHOD__ . ' set cookie headers', $line);

                foreach ($line as $name => $value)
                {
                    Cookie::set($name, $value['value'], $value['expiration']);
                }
                continue;
            }

            Base::getHttp()->header($line, $replace);
        }

        return $this;
    }
protected function _sendHeadersToPhp(array $headers, $replace)
    {
        if (Base::getHttp()->headersSent())
        {
            return $this;
        }

        foreach ($headers as $key => $line)
        {
            Base::getLog()->debug(__METHOD__ . ' send headers to php', [
                'key'   => $key,
                'value' => $line,
            ]);
            if ($key == 'Set-Cookie' && is_array($line))
            {
                Base::getLog()->debug(__METHOD__ . ' set cookie headers', $line);

                foreach ($line as $name => $value)
                {
                    Cookie::set($name, $value['value'], $value['expiration']);
                }
                continue;
            }

            Base::getHttp()->header($line, $replace);
        }

        return $this;
    }
发送header信息

@param  array $headers
@param  bool  $replace
@return $this