略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: VarnishAdmin::__construct

2024-11-13

VarnishAdmin::__construct

(PECL varnish >= 0.3)

VarnishAdmin::__constructVarnishAdmin constructor

说明

public VarnishAdmin::__construct(array $args = ?)

参数

args

Configuration arguments. The possible keys are:

VARNISH_CONFIG_IDENT - local varnish instance ident
VARNISH_CONFIG_HOST - varnish instance ip
VARNISH_CONFIG_PORT - varnish instance port
VARNISH_CONFIG_SECRET - varnish instance secret
VARNISH_CONFIG_TIMEOUT - connection read timeout
VARNISH_CONFIG_COMPAT - varnish major version compatibility

返回值

范例

示例 #1 VarnishAdmin::__construct() example

<?php
    $args 
= array(
        
VARNISH_CONFIG_HOST => "::1",
        
VARNISH_CONFIG_PORT => 6082,
        
VARNISH_CONFIG_SECRET => "5174826b-8595-4958-aa7a-0609632ad7ca",
        
VARNISH_CONFIG_TIMEOUT => 300,
    );
    
$va = new VarnishAdmin($args);
?>
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/varnishadmin.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3