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


PHP mysql_squid_builder::TIME_FROM_DANSGUARDIAN_EVENTS_TABLE方法代码示例

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


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

示例1: js

function js()
{
    $tpl = new templates();
    $table = $_GET["table"];
    $page = CurrentPageName();
    $q = new mysql_squid_builder();
    $time = $q->TIME_FROM_DANSGUARDIAN_EVENTS_TABLE($table);
    $dateT = date("Y {l} {F} d", $time);
    if ($tpl->language == "fr") {
        $dateT = date("{l} d {F} Y", $time);
    }
    $title[] = $dateT;
    if ($_GET["field"] != null) {
        $title[] = $_GET["field"];
    }
    if ($_GET["value"] != null) {
        $title[] = $_GET["value"];
    }
    if ($_GET["sitename"] != null) {
        $title[] = $_GET["sitename"];
    }
    $finaltitle = $tpl->_ENGINE_parse_body(@implode("»", $title));
    $uri = "popup=yes&table={$table}&field={$_GET["field"]}&value={$_GET["value"]}&sitename={$_GET["sitename"]}";
    echo "YahooWinBrowse('950','{$page}?{$uri}','{$finaltitle}');";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:squid.dansguardian_events.php

示例2: REPAIR_WORKING_TABLES

function REPAIR_WORKING_TABLES()
{
    $q = new mysql_squid_builder();
    $LIST_TABLES_DAYS = $q->LIST_TABLES_HOURS();
    events(count($LIST_TABLES_DAYS) . " daily tables");
    while (list($tablename, $ligne) = each($LIST_TABLES_DAYS)) {
        $xtime = $q->TIME_FROM_HOUR_TABLE($tablename);
        $xdate = date("Y-m-d", $xtime);
        $danstable = "dansguardian_events_" . date("Ymd", $xtime);
        if ($GLOBALS["VERBOSE"]) {
            echo "{$tablename}: {$danstable} = {$xdate}\n";
        }
        $q->QUERY_SQL("INSERT IGNORE INTO tables_day (tablename,zDate) VALUES ('{$tablename}','{$xdate}')");
    }
    $currentTABLE = date("Ymd") . "_hour";
    $LIST_TABLES_dansguardian_events = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $ligne) = each($LIST_TABLES_dansguardian_events)) {
        $xtime = $q->TIME_FROM_DANSGUARDIAN_EVENTS_TABLE($tablename);
        $hour_table = date("Ymd", $xtime) . "_hour";
        if ($currentTABLE == $hour_table) {
            continue;
        }
        if (!$q->TABLE_EXISTS($hour_table)) {
            events(" ####### WARNING - NO TABLE {$hour_table} #############");
        }
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:27,代码来源:exec.squid.reports-scheduled.php

示例3: ScanDays

function ScanDays($onlyTable = false)
{
    $q = new mysql_squid_builder(true);
    $ARRAY_DAYS = array();
    $tables = $q->LIST_TABLES_dansguardian_events();
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_DANSGUARDIAN_EVENTS_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_TABLES_HOURS();
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_HOUR_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_TABLES_YOUTUBE_DAYS();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_YOUTUBE_DAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_TABLES_USERSIZED();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_USERSIZED_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_TABLES_QUOTADAY();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_QUOTADAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $tables = $q->LIST_CAT_FAMDAY();
    //youtubeday_
    while (list($tablename, $line) = each($tables)) {
        $dayTime = $q->TIME_FROM_CAT_FAMDAY_TABLE($tablename);
        $day = date("Y-m-d", $dayTime);
        $ARRAY_DAYS[$day] = $dayTime;
        $TABLES[$tablename] = true;
    }
    $prefix = "INSERT IGNORE INTO tables_day (tablename,zDate) VALUES ";
    while (list($day, $dayTime) = each($ARRAY_DAYS)) {
        $tablename = "dansguardian_events_" . date("Ymd", $dayTime);
        $f[] = "('{$tablename}','{$day}')";
    }
    if (count($f) > 0) {
        $q->QUERY_SQL($prefix . @implode(",", $f));
        if (!$q->ok) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Fatal {$q->mysql_error}\n";
            }
            squid_admin_purge(0, "Fatal {$q->mysql_error}", "Backup process cannot be performed", __FILE__, __LINE__);
            ufdbguard_admin_events("Fatal {$q->mysql_error}", __FUNCTION__, __FILE__, __LINE__, "backup");
            return false;
        }
    }
    if ($onlyTable) {
        return $TABLES;
    }
    return true;
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:71,代码来源:exec.squidlogs.purge.php

示例4: repair_from_sources_tables

function repair_from_sources_tables()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    if ($GLOBALS["VERBOSE"]) {
        echo "time: {$timefile}\n";
    }
    $pid = @file_get_contents($pidfile);
    if (!$GLOBALS["VERBOSE"]) {
        if (!$GLOBALS["FORCE"]) {
            if ($unix->process_exists($pid, basename(__FILE__))) {
                if ($GLOBALS["VERBOSE"]) {
                    echo "Already executed pid {$pid}\n";
                }
                return;
            }
            if ($pid < 100) {
                $pid = null;
            }
            $mypid = getmypid();
            @file_put_contents($pidfile, $mypid);
        }
    }
    if ($GLOBALS["FORCE_TIME"]) {
        $timeexec = $unix->file_time_min($timefile);
        if ($timeexec < 240) {
            return;
        }
    }
    @unlink($timefile);
    @file_put_contents($timefile, time());
    $Prefix = "/usr/share/artica-postfix";
    $php5 = $unix->LOCATE_PHP5_BIN();
    $nohup = $unix->find_program("nohup");
    $EXEC_NICE = $unix->EXEC_NICE();
    $q = new mysql_squid_builder();
    $C = 0;
    $array = $q->LIST_TABLES_dansguardian_events();
    $current = "dansguardian_events_" . date("Ymd");
    while (list($tablename, $none) = each($array)) {
        if ($tablename == $current) {
            continue;
        }
        $time = $q->TIME_FROM_DANSGUARDIAN_EVENTS_TABLE($tablename);
        $xtime = date("Y-m-d", $time);
        $hour_table = date("Ymd", $time) . "_hour";
        $member_table = date("Ymd", $time) . "_members";
        $SUM_SOURCE = $q->COUNT_ROWS($tablename);
        if ($SUM_SOURCE == 0) {
            continue;
        }
        $SUM_DEST = $q->COUNT_ROWS($hour_table);
        $PERC = $SUM_DEST / $SUM_SOURCE * 100;
        $PERC = intval($PERC);
        echo "{$xtime}] {$SUM_SOURCE} - {$SUM_DEST} = {$PERC}% - {$tablename}\n";
        if ($PERC < 5) {
            if (!$q->CreateHourTable($hour_table)) {
                echo "{$xtime}] {$tablename} unable to create {$hour_table}\n";
                continue;
            }
            _repair_from_sources_tables($tablename, $hour_table);
            $q->QUERY_SQL("UPDATE tables_day SET `totalsize`='0',`requests`=0,`MembersCount`=0,`month_flow`=0,weekdone=0,weekbdone=0 WHERE tablename='{$tablename}'");
            $C++;
        }
        $ligne1 = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(hits) as hits FROM {$tablename}"));
        if (!$q->ok) {
            echo $q->mysql_error;
        }
        $SumDehits_src = $ligne1["hits"];
        $ligne1 = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(hits) as hits FROM {$member_table}"));
        $SumDehits_dest = $ligne1["hits"];
        $PERC = $SumDehits_dest / $SumDehits_src * 100;
        $PERC = intval($PERC);
        echo "{$xtime}] {$SumDehits_src} - {$SumDehits_dest} = {$PERC}% - {$member_table}\n";
        if ($PERC < 90) {
            if (!$q->CreateMembersDayTable($hour_table)) {
                echo "{$xtime}] {$tablename} unable to create {$hour_table}\n";
                continue;
            }
            _repair_members_sources_tables($tablename, $member_table);
            $C++;
        }
    }
    if ($C > 0) {
        shell_exec(trim("{$EXEC_NICE} {$php5} {$Prefix}/exec.squid.stats.totals.php --repair --byschedule --schedule-id={$GLOBALS["SCHEDULE_ID"]}"));
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:88,代码来源:exec.squid.stats.repair.php


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