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


PHP sockets::SQUID_DISABLE_STATS_DIE方法代码示例

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


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

示例1: dirname

if (preg_match("#--rebuild#", implode(" ", $argv))) {
    $GLOBALS["REBUILD"] = true;
}
if ($GLOBALS["VERBOSE"]) {
    "******* echo Loading... *******\n";
}
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.squid.builder.php';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/ressources/class.os.system.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
if ($GLOBALS["VERBOSE"]) {
    "echo Parsing arguments...\n";
}
$sock = new sockets();
$sock->SQUID_DISABLE_STATS_DIE();
$GLOBALS["Q"] = new mysql_squid_builder();
if ($argv[1] == "--table") {
    _xprocess_table($argv[2]);
    exit;
}
if ($argv[1] == "--all") {
    process_all_tables();
    exit;
}
if ($argv[1] == "--xtime") {
    process_xtable($argv[2]);
    exit;
}
if ($argv[1] == "--repair-tables") {
    repair_tables();
开发者ID:articatech,项目名称:artica,代码行数:31,代码来源:exec.squid.stats.categorize-table.php

示例2: start

function start()
{
    $unix = new unix();
    $pidfile = "/var/run/squid-stats-central.pid";
    $timefile = $GLOBALS["TIMEFILE"];
    $sock = new sockets();
    if (!$unix->is_socket("/var/run/mysqld/squid-db.sock")) {
        stats_admin_events(0, "MySQL server not ready, delay task...", null, __FILE__, __LINE__);
        $unix->THREAD_COMMAND_SET($unix->LOCATE_PHP5_BIN() . " " . __FILE__);
        die;
    }
    $WizardStatsApplianceDisconnected = intval($sock->GET_INFO("WizardStatsApplianceDisconnected"));
    if ($WizardStatsApplianceDisconnected == 1) {
        $export_stamp = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".EXPORT.time";
        $export_time = $unix->file_time_min($export_stamp);
        if ($export_time > 60) {
            start_export();
            export_push();
            @unlink($export_stamp);
            @file_put_contents($export_stamp, time());
        }
        die;
    }
    if (!$GLOBALS["NOTIME"]) {
        @unlink($timefile);
        @file_put_contents($timefile, time());
    }
    stats_admin_events(2, " **** STARTING Statistics Engine ****", null, __FILE__, __LINE__);
    percentage("**** STARTING Statistics Engine ****", 0);
    percentage("**** Importing tables ****", 2);
    start_import(true);
    $sock->SQUID_DISABLE_STATS_DIE();
    $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);
    }
    $DisableArticaProxyStatistics = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/DisableArticaProxyStatistics"));
    if ($DisableArticaProxyStatistics == 1) {
        percentage("{disabled}", 100);
        stats_admin_events(1, "100%) Statistics are disabled");
        StampDone(1000, "Statistics are disabled");
        return;
    }
    @unlink("/var/run/squid-stats-central.stop");
    if (!$GLOBALS["NOTIME"]) {
        @unlink($timefile);
        @file_put_contents($timefile, time());
    }
    $tSource = time();
    $php5 = $unix->LOCATE_PHP5_BIN();
    $nohup = $unix->find_program("nohup");
    $EXEC_NICE = $unix->EXEC_NICE();
    $Prefix = "/usr/share/artica-postfix";
    $q = new mysql_squid_builder();
    $GLOBALS["Q"] = $q;
    @mkdir("/home/artica/categories_databases", 0755, true);
    $unix->chmod_func(0755, "/home/artica/categories_databases/*");
    $unix->chmod_func(0755, "/home/artica/categories_perso/*");
    if (!StampOK(5)) {
        percentage("Reloading categories Daemon...", 2);
        shell_exec("/etc/init.d/ufdbcat reload");
    }
    $t = time();
    if (!StampOK(10)) {
        percentage("Purge old days", 1);
        shell_exec(trim("{$EXEC_NICE} {$php5} {$Prefix}/exec.squidlogs.purge.php"));
        stats_admin_events(2, "1%) Purge days took:" . $unix->distanceOfTimeInWords($t, time()), null, __FILE__, __LINE__);
        StampDone(10, "Purge old days");
    }
    if (!StampOK(20)) {
        percentage("Compile personal tables...", 2);
        shell_exec(trim("{$EXEC_NICE} {$php5} {$Prefix}/exec.squid.compile_category_perso.php"));
        Step2();
        StampDone(20, "Compile personal tables");
    }
    $t = time();
    if (!StampOK(30)) {
        percentage("Running Quota day", 2);
        shell_exec(trim("{$EXEC_NICE} {$php5} {$Prefix}/exec.squid.stats.quotaday.php"));
        stats_admin_events(2, "2%) Quota day executed took:" . $unix->distanceOfTimeInWords($t, time()), null, __FILE__, __LINE__);
        StampDone(30, "Running Quota day");
    }
    if (SquidStatisticsTasksOverTime()) {
        stats_admin_events(1, "Statistics overtime... Aborting", null, __FILE__, __LINE__);
        return;
    }
    if (!StampOK(40)) {
        percentage("Running Youtube Hours", 2);
        shell_exec(trim("{$EXEC_NICE} {$php5} {$Prefix}/exec.squid.stats.youtube.days.php --schedule-id={$GLOBALS["SCHEDULE_ID"]}"));
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.stats.central.php


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