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


PHP mysql_squid_builder::CheckDefaultSchedules方法代码示例

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


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

示例1: tasks

function tasks(){
	$t=time();
	$q=new mysql_squid_builder();
	$q->CheckDefaultSchedules();
	$html="
	<div id='tasks-$t'></div>
	
	<script>
		LoadAjax('tasks-$t','squid.databases.schedules.php');
	</script>
	
	
	";
	
	echo $html;
	
	
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:18,代码来源:squid.statistics.tasks.php

示例2: build_schedules

function build_schedules()
{
    $unix = new unix();
    $sock = new sockets();
    $q = new mysql();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pidTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        writelogs("Already executed pid {$pid}", __FILE__, __FUNCTION__, __LINE__);
        return;
    }
    @file_put_contents($pidfile, getmypid());
    $pidTimeINT = $unix->file_time_min($pidTime);
    if (!$GLOBALS["VERBOSE"]) {
        if ($pidTimeINT < 1) {
            writelogs("To short time to execute the process {$pidTime} = {$pidTimeINT}Mn < 1", __FILE__, __FUNCTION__, __LINE__);
            return;
        }
    }
    @file_put_contents($pidTime, time());
    if (!$q->TABLE_EXISTS("system_schedules", "artica_backup")) {
        $task->CheckDefaultSchedules();
    }
    $task = new system_tasks();
    $task->CheckDefaultSchedules();
    $squidbin = $unix->LOCATE_SQUID_BIN();
    if (file_exists($squidbin)) {
        $q = new mysql_squid_builder();
        $q->CheckDefaultSchedules();
    }
    if ($q->COUNT_ROWS("system_schedules", "artica_backup") == 0) {
        echo "Starting......: " . date("H:i:s") . " artica-postfix watchdog (fcron) system_schedules is empty !!\n";
        die;
    }
    $sql = "SELECT * FROM system_schedules WHERE enabled=1";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo "Starting......: " . date("H:i:s") . " artica-postfix watchdog (fcron) {$q->mysql_error} on line " . __LINE__ . "\n";
        return;
    }
    $php5 = $unix->LOCATE_PHP5_BIN();
    $WorkingDirectory = dirname(__FILE__);
    $chmod = $unix->find_program("chmod");
    $settings = unserialize(base64_decode($sock->GET_INFO("FcronSchedulesParams")));
    if (!isset($settings["max_nice"])) {
        $settings["max_nice"] = null;
    }
    if (!isset($settings["max_load_wait"])) {
        $settings["max_load_wait"] = null;
    }
    if (!isset($settings["max_load_avg5"])) {
        $settings["max_load_avg5"] = null;
    }
    if (!is_numeric($settings["max_load_avg5"])) {
        $settings["max_load_avg5"] = "2.5";
    }
    if (!is_numeric($settings["max_load_wait"])) {
        $settings["max_load_wait"] = "10";
    }
    if (!is_numeric($settings["max_nice"])) {
        $settings["max_nice"] = "19";
    }
    $max_load_wait = $settings["max_load_wait"];
    @unlink("/etc/cron.d/artica-cron");
    foreach (glob("/etc/cron.d/*") as $filename) {
        $file = basename($filename);
        if (preg_match("#syssch-[0-9]+#", $filename)) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " artica-postfix watchdog (fcron) remove {$filename}\n";
            }
            @unlink($filename);
        }
    }
    @unlink("/etc/artica-postfix/TASKS_CACHE.DB");
    @unlink("/etc/artica-postfix/system.schedules");
    $TRASNCODE["0 * * * *"] = "1h";
    $TRASNCODE["0 4,8,12,16,20 * * *"] = "4h";
    $TRASNCODE["0 0,4,8,12,16,20 * * *"] = "4h";
    $TRASNCODE["0 3,5,7,9,11,13,15,17,19,23 * * *"] = "3h";
    $TRASNCODE["0 0,3,5,7,9,11,13,15,17,19,23 * * *"] = "3h";
    $TRASNCODE["0 2,4,6,8,10,12,14,16,18,20,22 * * *"] = "2h";
    $TRASNCODE["0 0,2,4,6,8,10,12,14,16,18,20,22 * * *"] = "2h";
    $TRASNCODE["20,40,59 * * * *"] = "20";
    $TRASNCODE["0,20,40 * * * *"] = "20";
    $TRASNCODE["0,10,20,30,40,50 * * * *"] = "10";
    $nice = $unix->EXEC_NICE();
    build_system_defaults();
    $me = __FILE__;
    while ($ligne = mysql_fetch_assoc($results)) {
        $TaskType = $ligne["TaskType"];
        $TimeText = $ligne["TimeText"];
        if ($TaskType == 0) {
            continue;
        }
        if ($ligne["TimeText"] == null) {
            continue;
        }
        $md5 = md5("{$TimeText}{$TaskType}");
        if (isset($alreadydone[$md5])) {
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.schedules.php

示例3: Addefaults

function Addefaults()
{
    $q = new mysql_squid_builder();
    $q->CheckDefaultSchedules();
    $tpl = new templates();
    echo $tpl->javascript_parse_text("{add_defaults_added}");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:7,代码来源:squid.databases.schedules.php

示例4: build_schedules

function build_schedules($notfcron = false)
{
    $unix = new unix();
    $sock = new sockets();
    $squid = $unix->LOCATE_SQUID_BIN();
    if (!is_file($squid)) {
        return;
    }
    @mkdir("/var/log/artica-postfix/youtube", 0755, true);
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pidTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        writelogs("Already executed pid {$pid}", __FILE__, __FUNCTION__, __LINE__);
        return;
    }
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    @file_put_contents($pidfile, getmypid());
    $pidTimeINT = $unix->file_time_min($pidTime);
    if (!$GLOBALS["VERBOSE"]) {
        if ($pidTimeINT < 2) {
            writelogs("To short time to execute the process", __FILE__, __FUNCTION__, __LINE__);
            return;
        }
    }
    @file_put_contents($pidTime, time());
    if (!$unix->IsSquidTaskCanBeExecuted()) {
        if ($GLOBALS["VERBOSE"]) {
            echo "These tasks cannot be executed in this server\n";
        }
        return;
    }
    $q = new mysql_squid_builder();
    $q->CheckDefaultSchedules();
    if ($q->COUNT_ROWS("webfilters_schedules") == 0) {
        return;
    }
    $sql = "SELECT *  FROM webfilters_schedules WHERE enabled=1";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        return;
    }
    @unlink("/etc/cron.d/SquidTailInjector");
    $php5 = $unix->LOCATE_PHP5_BIN();
    $WorkingDirectory = dirname(__FILE__);
    $chmod = $unix->find_program("chmod");
    foreach (glob("/etc/cron.d/*") as $filename) {
        $file = basename($filename);
        if (preg_match("#squidsch-[0-9]+#", $filename)) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Removing old task {$file}\n";
            }
            @unlink($filename);
        }
    }
    @unlink("/etc/artica-postfix/TASKS_SQUID_CACHE.DB");
    $settings = unserialize(base64_decode($sock->GET_INFO("FcronSchedulesParams")));
    if (!isset($settings["max_nice"])) {
        $settings["max_nice"] = 19;
    }
    if (!isset($settings["max_load_avg5"])) {
        $settings["max_load_avg5"] = 3;
    }
    if (!isset($settings["max_load_wait"])) {
        $settings["max_load_wait"] = 10;
    }
    if (!is_numeric($settings["max_load_avg5"])) {
        $settings["max_load_avg5"] = "3";
    }
    if (!is_numeric($settings["max_load_wait"])) {
        $settings["max_load_wait"] = "10";
    }
    if (!is_numeric($settings["max_nice"])) {
        $settings["max_nice"] = "19";
    }
    $max_load_wait = $settings["max_load_wait"];
    $finalsettings = "nice({$settings["max_nice"]}),lavg5({$settings["max_load_avg5"]}),until({$max_load_wait})";
    @unlink("/etc/artica-postfix/squid.schedules");
    $nice = EXEC_NICE();
    $q = new mysql_squid_builder();
    $c = 0;
    $d = 0;
    while ($ligne = mysql_fetch_assoc($results)) {
        $allminutes = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59";
        $TaskType = $ligne["TaskType"];
        $TimeText = $ligne["TimeText"];
        if ($TaskType == 0) {
            continue;
        }
        if ($ligne["TimeText"] == null) {
            continue;
        }
        if ($EnableRemoteStatisticsAppliance == 1) {
            if ($q->tasks_remote_appliance[$TaskType]) {
                $d++;
                continue;
            }
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.php


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