當前位置: 首頁>>代碼示例>>PHP>>正文


PHP mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK方法代碼示例

本文整理匯總了PHP中mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK方法的具體用法?PHP mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK怎麽用?PHP mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mysql_squid_builder的用法示例。


在下文中一共展示了mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: macuid

function macuid()
{
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $unix = new unix();
    $pid = @file_get_contents($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        if ($GLOBALS["VERBOSE"]) {
            echo "Already executed pid {$pid}\n";
        }
        return;
    }
    $mypid = getmypid();
    @file_put_contents($pidfile, $mypid);
    $q = new mysql_squid_builder();
    $sql = "SELECT * FROM webfilters_nodes WHERE LENGTH(uid)>1";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    while ($ligne = mysql_fetch_assoc($results)) {
        if ($ligne["MAC"] == "00:00:00:00:00:00") {
            continue;
        }
        if (!IsPhysicalAddress($ligne["MAC"])) {
            continue;
        }
        if ($GLOBALS["VERBOSE"]) {
            echo "{$ligne["MAC"]} = {$ligne["uid"]}\n";
        }
        $array[$ligne["MAC"]] = $ligne["uid"];
    }
    $sql = "SELECT * FROM webfilters_ipaddr WHERE LENGTH(uid)>1";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    while ($ligne = mysql_fetch_assoc($results)) {
        $array2[$ligne["ipaddr"]] = $ligne["uid"];
    }
    $tablesBrutes = $q->LIST_TABLES_HOURS();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
        reset($array2);
        while (list($ipaddr, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE client='{$ipaddr}' AND LENGTH(uid)=0");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
        reset($array2);
        while (list($ipaddr, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE CLIENT='{$ipaddr}' AND LENGTH(uid)=0");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_BLOCKED_DAY();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            $uid = mysql_escape_string2($uid);
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
        }
    }
    $tablesBrutes = $q->LIST_TABLES_BLOCKED_WEEK();
    while (list($tablename, $none) = each($tablesBrutes)) {
        reset($array);
        while (list($mac, $uid) = each($array)) {
            if ($GLOBALS["VERBOSE"]) {
                echo "{$tablename}, {$mac} -> {$uid}\n";
            }
            if (IsCompressed($tablename)) {
                Uncompress($tablename);
            }
            $q->QUERY_SQL("UPDATE {$tablename} SET uid='{$uid}' WHERE MAC='{$mac}'");
//.........這裏部分代碼省略.........
開發者ID:brucewu16899,項目名稱:1.6.x,代碼行數:101,代碼來源:exec.squid.stats.php

示例2: clean_squid_stats_dbs

function clean_squid_stats_dbs()
{
    $sock = new sockets();
    $DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics");
    $CleanArticaSquidDatabases = $sock->GET_INFO("CleanArticaSquidDatabases");
    if (!is_numeric($DisableArticaProxyStatistics)) {
        $DisableArticaProxyStatistics = 0;
    }
    if (!is_numeric($CleanArticaSquidDatabases)) {
        $CleanArticaSquidDatabases = 0;
    }
    if (!$GLOBALS["FORCE"]) {
        if ($CleanArticaSquidDatabases == 0) {
            echo "Option is not activated...\n";
            return;
        }
    }
    $q = new mysql_squid_builder();
    $tables = $q->LIST_TABLES_DAYS();
    $rows = 0;
    $count_tables = 0;
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_DAYS_BLOCKED();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_HOURS();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_MEMBERS();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_MONTH();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_WEEKS();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_WORKSHOURS();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_BLOCKED_WEEK();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
    }
    $tables = $q->LIST_TABLES_BLOCKED_DAY();
    while (list($num, $table) = each($tables)) {
        $rows = $rows + $q->COUNT_ROWS($table);
        if ($GLOBALS["VERBOSE"]) {
            echo " Delete table {$table} {$rows} rows \n";
        }
        $count_tables++;
        $q->DELETE_TABLE($table);
//.........這裏部分代碼省略.........
開發者ID:brucewu16899,項目名稱:1.6.x,代碼行數:101,代碼來源:exec.mysql.clean.php

示例3: start_export

function start_export()
{
    $unix = new unix();
    $sock = new sockets();
    $q = new mysql_squid_builder();
    $ArticaProxyStatisticsBackupFolder = $sock->GET_INFO("ArticaProxyStatisticsBackupFolder");
    if ($ArticaProxyStatisticsBackupFolder == null) {
        $ArticaProxyStatisticsBackupFolder = "/home/artica/squid/backup-statistics";
    }
    $ArticaProxyStatisticsBackupFolder = $ArticaProxyStatisticsBackupFolder . "/export";
    $LIST_TABLES_YOUTUBE_HOURS = $q->LIST_TABLES_YOUTUBE_HOURS();
    $LIST_TABLES_SIZEHOURS = $q->LIST_TABLES_SIZEHOURS();
    $LIST_TABLES_QUOTA_HOURS = $q->LIST_TABLES_QUOTA_HOURS();
    $LIST_TABLES_QUOTADAY = $q->LIST_TABLES_QUOTADAY();
    $LIST_TABLES_QUOTAMONTH = $q->LIST_TABLES_QUOTAMONTH();
    $LIST_TABLES_SEARCHWORDS_HOURS = $q->LIST_TABLES_SEARCHWORDS_HOURS();
    $LIST_TABLES_SEARCHWORDS_DAY = $q->LIST_TABLES_SEARCHWORDS_DAY();
    $LIST_TABLES_dansguardian_events = $q->LIST_TABLES_dansguardian_events();
    $LIST_TABLES_HOURS = $q->LIST_TABLES_HOURS();
    $LIST_TABLES_USERSIZED = $q->LIST_TABLES_USERSIZED();
    $LIST_TABLES_YOUTUBE_WEEK = $q->LIST_TABLES_YOUTUBE_WEEK();
    $LIST_TABLES_WEEKS = $q->LIST_TABLES_WEEKS();
    $LIST_TABLES_MEMBERS = $q->LIST_TABLES_MEMBERS();
    $LIST_TABLES_GSIZE = $q->LIST_TABLES_GSIZE();
    $LIST_TABLES_GCACHE = $q->LIST_TABLES_GCACHE();
    $LIST_TABLES_VISITED = $q->LIST_TABLES_VISITED();
    $LIST_TABLES_BLOCKED = $q->LIST_TABLES_BLOCKED();
    $LIST_TABLES_BLOCKED_WEEK = $q->LIST_TABLES_BLOCKED_WEEK();
    $LIST_TABLES_BLOCKED_DAY = $q->LIST_TABLES_BLOCKED_DAY();
    $LIST_TABLES_WWWUID = $q->LIST_TABLES_WWWUID();
    $LIST_CAT_FAMDAY = $q->LIST_CAT_FAMDAY();
    while (list($tablename, $none) = each($LIST_TABLES_YOUTUBE_HOURS)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_SIZEHOURS)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_QUOTADAY)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_QUOTAMONTH)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_SEARCHWORDS_HOURS)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_SEARCHWORDS_DAY)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_QUOTA_HOURS)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_dansguardian_events)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_HOURS)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_USERSIZED)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_BLOCKED_WEEK)) {
        if (trim($tablename) == null) {
            continue;
        }
        $EXPORT_SOURCES[$tablename] = true;
    }
    while (list($tablename, $none) = each($LIST_TABLES_BLOCKED)) {
        if (trim($tablename) == null) {
            continue;
//.........這裏部分代碼省略.........
開發者ID:brucewu16899,項目名稱:1.6.x,代碼行數:101,代碼來源:exec.squid.stats.central.php


注:本文中的mysql_squid_builder::LIST_TABLES_BLOCKED_WEEK方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。