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


PHP squidbee::ufdbguard_value方法代码示例

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


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

示例1: ufdbguard27

function ufdbguard27()
{
    $unix = new unix();
    $sock = new sockets();
    $squid = new squidbee();
    $users = new usersMenus();
    $major = $unix->UFDBGUARDD_MAJOR();
    $minor = $unix->UFDBGUARDD_MINOR();
    $datas = unserialize(base64_decode($sock->GET_INFO("ufdbguardConfig")));
    $ufdbClass = new compile_ufdbguard();
    $datas = $ufdbClass->SetDefaultsConfig($datas);
    if (!isset($datas["url_rewrite_children_concurrency"])) {
        $datas["url_rewrite_children_concurrency"] = 2;
    }
    if (!isset($datas["url_rewrite_children_startup"])) {
        $datas["url_rewrite_children_startup"] = 5;
    }
    if (!isset($datas["url_rewrite_children_idle"])) {
        $datas["url_rewrite_children_idle"] = 5;
    }
    if (!is_numeric($datas["url_rewrite_children_concurrency"])) {
        $datas["url_rewrite_children_concurrency"] = 2;
    }
    if ($datas["url_rewrite_children_concurrency"] > 1) {
        $moinsC = "-C ";
    }
    if ($squid->EnableRemoteStatisticsAppliance == 1) {
        $RemoteStatisticsApplianceSettings = unserialize(base64_decode($sock->GET_INFO("RemoteStatisticsApplianceSettings")));
        if ($this->ASROOT) {
            echo "Starting......: " . date("H:i:s") . " [UFDB]: Using remote appliance {$RemoteStatisticsApplianceSettings["SERVER"]}:{$datas["listen_port"]} as Web filtering engine\n";
        }
        $datas["remote_server"] = $RemoteStatisticsApplianceSettings["SERVER"];
        $datas["UseRemoteUfdbguardService"] = 1;
        $datas["remote_port"] = $datas["listen_port"];
    }
    $binary = "/usr/share/artica-postfix/ufdbgclient.php";
    $log = "-l /var/log/squid";
    if (!is_numeric($datas["listen_port"])) {
        $datas["listen_port"] = "3977";
    }
    if (!is_numeric($datas["tcpsockets"])) {
        $datas["tcpsockets"] = 1;
    }
    if (!is_numeric($datas["remote_port"])) {
        $datas["remote_port"] = 3977;
    }
    if ($datas["remote_port"] == null) {
        $datas["UseRemoteUfdbguardService"] = 0;
    }
    if ($datas["listen_addr"] == null) {
        $datas["listen_addr"] = "127.0.0.1";
    }
    if ($datas["listen_addr"] == "all") {
        $datas["listen_addr"] = "127.0.0.1";
    }
    if ($datas["UseRemoteUfdbguardService"] == 1) {
        if (trim($datas["remote_server"] == null)) {
            $datas["remote_server"] = "127.0.0.1";
        }
        $address = "-S {$datas["remote_server"]} -p {$datas["remote_port"]} ";
        echo "Starting......: " . date("H:i:s") . " ufdbguardd: Use remote ufdbguard service: {$datas["remote_server"]}:{$datas["remote_port"]}\n";
        $GLOBALS[__FUNCTION__] = "{$binary} {$moinsC}{$address} {$log}";
        return "{$binary} {$moinsC}{$address} {$log}";
    }
    $effective_port = $squid->ufdbguard_value("port");
    echo "Starting......: " . date("H:i:s") . " ufdbguardd: Effective port:`{$effective_port}`\n";
    if (is_numeric($effective_port)) {
        $datas["tcpsockets"] = 1;
    }
    if ($major > 0) {
        if ($minor > 26) {
            if ($datas["tcpsockets"] == 1) {
                if (trim($datas["listen_addr"] == null)) {
                    $datas["listen_addr"] = "127.0.0.1";
                }
                echo "Starting......: " . date("H:i:s") . " ufdbguardd: Use remote ufdbguard service: {$datas["listen_addr"]}:{$datas["remote_port"]}\n";
                $address = "-S {$datas["listen_addr"]} -p {$datas["listen_port"]} ";
                $GLOBALS[__FUNCTION__] = "{$binary} {$moinsC}{$address} {$log}";
                $f[] = "url_rewrite_program {$binary} {$moinsC}{$address} {$log}";
                $f[] = $squid->url_rewrite_children();
                return @implode("\n", $f);
            }
        }
    }
    echo "Starting......: " . date("H:i:s") . " ufdbguardd: Use remote ufdbguard service: {$binary} {$moinsC}{$log}\n";
    $GLOBALS[__FUNCTION__] = "{$binary} {$moinsC}{$log}";
    $f[] = "url_rewrite_program /usr/share/artica-postfix/ufdbgclient.php";
    $f[] = $squid->url_rewrite_children();
    return @implode("\n", $f);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:90,代码来源:exec.squid27.php


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