Send header

@param WP_Dependences $wp_dependences
@param string $type style|script
@return void
14589
protected function _send_http2_server_push_header( $wp_dependences, $type ) {
		global $wp_version;

		$registerd = $wp_dependences->registered;
		$wp_dependences->all_deps( $wp_dependences->queue );

		$handles = $wp_dependences->to_do;
		$handles = apply_filters( 'inc2734_wp_page_speed_optimization_http2_server_push_handles', $handles, $type );

		if ( ! $handles ) {
			return;
		}

		foreach ( $handles as $handle ) {
			if ( ! isset( $registerd[ $handle ] ) ) {
				continue;
			}

			$src = $registerd[ $handle ]->src;
			if ( ! $src ) {
				continue;
			}

			$ver = $registerd[ $handle ]->ver ? $registerd[ $handle ]->ver : $wp_version;
			$src = add_query_arg( 'ver', $ver, $src );

			header( sprintf( 'Link: <%s>; rel=preload; as=%s', esc_url_raw( $src ), $type ), false );
		}
	}
241176
private function title($title, $type, $verboseLvl = null)
    {
        $this->simple('<'.$type.'>'.$title.'</'.$type.'>', $verboseLvl, false);
    }
615317
public function onTable($type = null)
    {
        if (!is_null($type)) {
            Breadcrumbs::register('notifications-' . $type, function($breadcrumbs) use($type) {
                $breadcrumbs->push('Notifications ' . ucfirst($type), handles('antares::notifications/index'));
            });
            view()->share('breadcrumbs', Breadcrumbs::render('notifications-' . $type));
        }
    }
62459
private function setReponseHeaders($contentType = 'text/html', array $cookies = array())
    {
        $powered = Config::getParam('poweredBy', 'PSFS');
        header('X-Powered-By: ' . $powered);
        ResponseHelper::setStatusHeader($this->getStatusCode());
        ResponseHelper::setAuthHeaders($this->isPublicZone());
        ResponseHelper::setCookieHeaders($cookies);
        header('Content-type: ' . $contentType);

    }
1053366
public function onFrame($data, $type)
    {
        if ($data === 'ping') {
            $this->client->sendFrame('pong', 'STRING',
                function ($client) { // optional. called when the frame is transmitted to the client
                    \PHPDaemon\Core\Daemon::log('ExampleWebSocket: \'pong\' received by client.');
                }
            );
        }
    }
1213547
public function sendEmail(EmailType $type)
    {
        $builder = $this->builder;
        $type->buildEmail($builder);
        $email = $builder->build(new SwiftEmail());

        $this->mailer->send($email->getMessage());
    }
310112
public function block($type = null, $extra = null)
    {
        $this->addContext('blocked', true);

        if (isset($type)) {
            $this->registerEvent($type, $extra);
        }

        if (is_callable($this->responseCodeHandler)) {
            $responseCodeHandler = $this->responseCodeHandler;
            $responseCodeHandler(403, 'Forbidden');
        }
        else {
            $this->error('No response code handler available.');
        }

        if (is_callable($this->exitHandler)) {
            $exitHandler = $this->exitHandler;
            $exitHandler();
        }
        else {
            // $this->error('No exit callable set. PHP exit construct will be used.');
            exit;
        }
    }
351608
public function send($routing_key, $message, $exchange = null, $type = Amqp::TYPE_TOPIC)
    {
        $this->amqp->send($exchange ?: $this->exchange, $routing_key, $message, $type);
    }
260654
public function getHeader($type = 'content_type')
    {
        return (array_key_exists($type, $this->result)) ? $this->result[$type] : null;
    }
495424
public function sendHeaders(): void
    {
        foreach ((array) $this->headers as $name => $value) {
            $this->sendHeader($name, $value);
        }
    }
1226551
protected function sendHttpHeaders(iterable $headers):void
    {
        foreach ($headers as $header => $value) {
            header("$header: $value", false);
        }
    }
1044185
public function report($type, $data)
    {
        if (!$reporters = $this->reporters()) {
            return;
        }
        $reporters->dispatch($type, $data);
    }
594986
public void setContentType(String type) {
		checkContentType(type);
		checkCommitted();
		String name = getCorrectHeaderName(ContentTypeHeader.NAME);
		try {
			Header h = SipFactoryImpl.headerFactory.createHeader(name, type);
			this.message
					.removeHeader(getCorrectHeaderName(ContentTypeHeader.NAME));
			this.message.addHeader(h);
		} catch (ParseException e) {
			logger.error("Error while setting content type header !!!", e);
		}

	}
373828
protected function write($name, $type, $source, $dependencies = array())
    {
        $types = array(
            'script' => 'script',
            'style'  => 'style',
            'js'     => 'script',
            'css'    => 'style'
        );

        if (array_key_exists($type, $types))
        {
            $type = $types[$type];

            $this->register($type, $name, $source, $dependencies, array());
        }

        return $this;
    }
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
1309509
public function onFrame($data, $type)
    {
        $ws = $this;
        $req = json_decode($data, true);
        if ($req['type'] === 'subscribe') {
            $eventName = $req['event'];
            $this->appInstance->pubsub->sub($req['event'], $this, function ($data) use ($ws, $eventName) {
                $ws->sendObject([
                    'type' => 'event',
                    'event' => $eventName,
                    'data' => $data,
                ]);
            });
        }
    }
232562
public function sendPacket($type, $packet)
    {
        $header = $type . pack('N', mb_orig_strlen($packet) + 4);

        $this->write($header);
        $this->write($packet);

        if ($this->pool->config->protologging->value) {
            Daemon::log('Client --> Server: ' . Debug::exportBytes($header . $packet) . "\n\n");
        }

        return true;
    }