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


PHP mysql_squid_builder::LIST_TABLES_SEARCHWORDS_DAY方法代码示例

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


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

示例1: updates_retranslation

function updates_retranslation($MAC, $uid)
{
    $GLOBALS["Q"] = new mysql_squid_builder();
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading...\n";
    }
    $unix = new unix();
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading done...\n";
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . md5($MAC . $uid) . ".pid";
    $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . md5($MAC . $uid) . ".time";
    $pid = @file_get_contents($pidfile);
    if (!$GLOBALS["FORCE"]) {
        if ($pid < 100) {
            $pid = null;
        }
        $unix = new unix();
        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 = "UPDATE youtube_all SET uid='{$uid}' WHERE MAC='{$MAC}'";
    $q->QUERY_SQL($sql);
    $sql = "UPDATE UserAuthDaysGrouped SET uid='{$uid}' WHERE MAC='{$MAC}'";
    $q->QUERY_SQL($sql);
    $sql = "UPDATE UserAuthDays SET uid='{$uid}' WHERE MAC='{$MAC}'";
    $q->QUERY_SQL($sql);
    $TABLES = $q->LIST_TABLES_QUOTADAY();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_QUOTAMONTH();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_USERSIZED();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_YOUTUBE_HOURS();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_YOUTUBE_DAYS();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_YOUTUBE_WEEK();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_SEARCHWORDS_DAY();
    while (list($tablename, $rows) = each($TABLES)) {
        $sql = "UPDATE `{$tablename}` SET uid='{$uid}' WHERE MAC='{$MAC}'";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo $q->mysql_error;
        }
    }
    $TABLES = $q->LIST_TABLES_SEARCHWORDS_HOURS();
    while (list($tablename, $rows) = each($TABLES)) {
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.retranslations.updates.php

示例2: BuildWeeks

function BuildWeeks()
{
    if ($GLOBALS["VERBOSE"]) {
        echo "BuildWeeks(): OK\n";
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".pid";
    $pidtime = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".time";
    $pid = @file_get_contents($pidfile);
    $unix = new unix();
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $time = $unix->PROCCESS_TIME_MIN($pid);
        events("Already executed pid {$pid} since {$time}mn-> DIE");
        if ($GLOBALS["VERBOSE"]) {
            echo "Already executed pid {$pid} since {$time}mn\n";
        }
        die;
    }
    $mypid = getmypid();
    @file_put_contents($pidfile, $mypid);
    $timefile = $unix->file_time_min($pidfile);
    if ($GLOBALS["VERBOSE"]) {
        echo "Timelock:{$timefile} Mn\n";
    }
    if (!$GLOBALS["VERBOSE"]) {
        if ($timefile < 10) {
            return;
        }
    }
    @unlink($pidfile);
    @file_put_contents($pidfile, time());
    $q = new mysql_squid_builder();
    $CurrentTableDay = "searchwordsD_" . date("Ymd");
    $LIST_TABLES_SEARCHWORDS_DAY = $q->LIST_TABLES_SEARCHWORDS_DAY();
    $sql = "SELECT tablename, zDate, DATE_FORMAT( zDate, '%Y%m%d' ) AS tablesuffix,\n\t\t\tYEAR(zDate) as YearNumber,\n\t\t\tWEEK( zDate ) as WeekNumber  FROM tables_day WHERE SearchWordWeek=0 AND DATE_FORMAT( zDate, '%Y-%m-%d' ) < DATE_FORMAT( NOW( ) , '%Y-%m-%d' )";
    $results = $q->QUERY_SQL($sql);
    if (mysql_num_rows($results) == 0) {
        if ($GLOBALS["VERBOSE"]) {
            echo "SearchWordWeek, no table to increment\n";
        }
        return;
    }
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $SourceTable = "searchwordsD_" . $ligne["tablesuffix"];
        $tablename = $ligne["tablename"];
        if ($GLOBALS["VERBOSE"]) {
            echo "{$tablename} -> {$SourceTable}\n";
        }
        if (!isset($LIST_TABLES_SEARCHWORDS_DAY[$SourceTable])) {
            if ($GLOBALS["VERBOSE"]) {
                echo "{$SourceTable}, no such table...\n";
            }
            continue;
        }
        $NexTable = "searchwordsW_" . $ligne["YearNumber"] . $ligne["WeekNumber"];
        if (!$q->check_SearchWords_week($ligne["YearNumber"] . $ligne["WeekNumber"])) {
            if ($GLOBALS["VERBOSE"]) {
                echo "check_SearchWords_week({$NexTable}) failed\n";
            }
        }
        if (_BuildWeeks($SourceTable, $NexTable)) {
            if ($GLOBALS["VERBOSE"]) {
                echo "{$SourceTable} -> {$NexTable} OK\n";
            }
            $q->QUERY_SQL("UPDATE tables_day SET SearchWordWeek=" . count($GLOBALS[$SourceTable]) . " WHERE tablename='{$tablename}'");
        }
        if (system_is_overloaded(__FILE__)) {
            ufdbguard_admin_events("Overloaded system, aborting task", __FUNCTION__, __FILE__, __LINE__, "stats");
            return;
        }
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:71,代码来源:exec.squid-searchwords.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_SEARCHWORDS_DAY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。