当前位置: 首页>>代码示例>>PHP>>正文


PHP squidbee::dns_nameservers方法代码示例

本文整理汇总了PHP中squidbee::dns_nameservers方法的典型用法代码示例。如果您正苦于以下问题:PHP squidbee::dns_nameservers方法的具体用法?PHP squidbee::dns_nameservers怎么用?PHP squidbee::dns_nameservers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在squidbee的用法示例。


在下文中一共展示了squidbee::dns_nameservers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build

function build()
{
    $sock = new sockets();
    $unix = new unix();
    $ini = new Bs_IniHandler();
    $squid = new squidbee();
    $IPADDRSSL = array();
    $IPADDRSSL2 = array();
    $ArticaSquidParameters = $sock->GET_INFO('ArticaSquidParameters');
    $SquidAsMasterPeer = intval($sock->GET_INFO("SquidAsMasterPeer"));
    $SquidAsMasterPeerPort = intval($sock->GET_INFO("SquidAsMasterPeerPort"));
    $SquidAsMasterPeerPortSSL = intval($sock->GET_INFO("SquidAsMasterPeerPortSSL"));
    $SquidAsMasterPeerIPAddr = $sock->GET_INFO("SquidAsMasterPeerIPAddr");
    $visible_hostname = $ini->_params["NETWORK"]["visible_hostname"];
    if ($visible_hostname == null) {
        $visible_hostname = $unix->hostname_g();
    }
    $SquidBinIpaddr = $sock->GET_INFO("SquidBinIpaddr");
    $AllowAllNetworksInSquid = $sock->GET_INFO("AllowAllNetworksInSquid");
    if (!is_numeric($AllowAllNetworksInSquid)) {
        $AllowAllNetworksInSquid = 1;
    }
    $ini->loadString($ArticaSquidParameters);
    $ZipProxyListenIpAdress = $sock->GET_INFO("ZipProxyListenIpAdress");
    $zipproxy_port = intval($sock->GET_INFO("zipproxy_port"));
    if ($zipproxy_port == 0) {
        $zipproxy_port = 5561;
    }
    $zipproxy_MaxSize = intval($sock->GET_INFO("zipproxy_MaxSize"));
    if ($zipproxy_MaxSize == 0) {
        $zipproxy_MaxSize = 1048576;
    }
    $ZipProxyUnrestricted = intval($sock->GET_INFO("ZipProxyUnrestricted"));
    $ConvertToGrayscale = intval($sock->GET_INFO("ConvertToGrayscale"));
    $zipproxy_ProcessHTML = intval($sock->GET_INFO("zipproxy_ProcessHTML"));
    $zipproxy_ProcessCSS = intval($sock->GET_INFO("zipproxy_ProcessCSS"));
    $zipproxy_ProcessJS = intval($sock->GET_INFO("zipproxy_ProcessJS"));
    NETWORK_ALL_INTERFACES();
    if ($ZipProxyListenIpAdress != null) {
        if (!isset($GLOBALS["NETWORK_ALL_INTERFACES"][$ZipProxyListenIpAdress])) {
            $f[] = "# {$ZipProxyListenIpAdress} Interface Hardware error";
        }
    }
    $dns_nameservers = $squid->dns_nameservers(true);
    $hostname = $unix->hostname_g();
    if ($SquidAsMasterPeerIPAddr == "0.0.0.0") {
        $SquidAsMasterPeerIPAddr = null;
    }
    if ($SquidAsMasterPeerIPAddr == null) {
        $SquidAsMasterPeerIPAddr = "127.0.0.1";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Listen......: {$ZipProxyListenIpAdress}:{$zipproxy_port}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Unrestricted: {$ZipProxyUnrestricted}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Master......: {$SquidAsMasterPeerIPAddr}:{$SquidAsMasterPeerPort}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Convert to g: {$ConvertToGrayscale}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Process JS..: {$zipproxy_ProcessJS}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Process CSS.: {$zipproxy_ProcessCSS}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Configuring...: " . date("H:i:s") . " [INIT]: Process HTML: {$zipproxy_ProcessHTML}\n";
    }
    $f[] = "############################";
    $f[] = "# daemon mode-only options #";
    $f[] = "############################";
    $f[] = "";
    $f[] = "## Port to listen for proxy connections";
    $f[] = "## default: 8080";
    $f[] = "Port = {$zipproxy_port}";
    $f[] = "";
    $f[] = "## Local address to listen for proxy connections";
    $f[] = "## If you have more than one network interface,";
    $f[] = "## it's useful for restricting to which interface you want to bind to.";
    $f[] = "## By default Ziproxy binds to all interfaces.";
    if ($ZipProxyListenIpAdress != null) {
        $f[] = "Address = \"{$ZipProxyListenIpAdress}\"";
    }
    $f[] = "";
    $f[] = "## Accepts conections only from that address.";
    $f[] = "## WARNING: Remember to restrict the access to Ziproxy";
    $f[] = "## if your machine is directly connected to the Internet.";
    if ($ZipProxyUnrestricted == 0) {
        $backends = $squid->backends_list();
        $f[] = "OnlyFrom = \"" . @implode(" ", $backends) . "\"";
    }
    $f[] = "";
    $f[] = "## Limits the number of simultaneous active user connections.";
    $f[] = "## This does not affect the connection queue (see: SOMAXCONN).";
    $f[] = "##";
    $f[] = "## This also (indirectly) limits the number of processes Ziproxy will run";
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.zipproxy.php


注:本文中的squidbee::dns_nameservers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。