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


PHP scale_trigger函数代码示例

本文整理汇总了PHP中scale_trigger函数的典型用法代码示例。如果您正苦于以下问题:PHP scale_trigger函数的具体用法?PHP scale_trigger怎么用?PHP scale_trigger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: mysql_connect

if (TREASURER_DISABLED == TRUE || TIMEKOIN_DISABLED == TRUE) {
    // This has been disabled
    exit;
}
//***********************************************************************************
//***********************************************************************************
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
//***********************************************************************************
// External Flood Protection
log_ip("TR", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'treasurer_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'treasurer_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('treasurer_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'treasurer_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
ini_set('user_agent', 'Timekoin Server (Treasurer) v' . TIMEKOIN_VERSION);
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:treasurer.php

示例2: log_ip

    //Direct Input Transaction get a count boost
    //to help prevent direct Transaction spamming
    if ($transaction_attribute == "T") {
        log_ip("QU", scale_trigger(100));
    } else {
        if ($transaction_attribute == "G") {
            log_ip("QU", scale_trigger(3));
        } else {
            log_ip("QU", scale_trigger(25));
        }
    }
    exit;
}
//***********************************************************************************
// External Flood Protection
log_ip("QU", scale_trigger(10));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'queueclerk_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'queueclerk_last_heartbeat' LIMIT 1"), 0, 0);
$clone_id = $_GET["clone_id"];
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('queueclerk_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'queueclerk_last_heartbeat' LIMIT 1");
} else {
    if (empty($clone_id) == TRUE) {
        // Record already exist, called while another process of this script
        // was already running.
        exit;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:queueclerk.php

示例3: header

        }
        header("Location: index.php?menu=system&code=2");
        exit;
    } else {
        header("Location: index.php?menu=system&code=89");
        exit;
    }
}
$mysql_link = mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
log_ip("WA", scale_trigger(5));
// Avoid flood loading system process
while (1) {
    // Set timeout
    set_time_limit(300);
    // Are we to remain active?
    $loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'watchdog_heartbeat_active' LIMIT 1"), 0, 0);
    if ($loop_active === FALSE) {
        // Database Error, try to re-establish a connection after 5 seconds
        mysql_close($mysql_link);
        sleep(5);
        $mysql_link = mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
        mysql_select_db(MYSQL_DATABASE);
        // Keep track of errors in case this can't be recovered from
        $datbase_error = TRUE;
        $database_error_counter++;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:watchdog.php

示例4: mysql_connect

if (BALANCE_DISABLED == TRUE || TIMEKOIN_DISABLED == TRUE) {
    // This has been disabled
    exit;
}
//***********************************************************************************
//***********************************************************************************
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
//***********************************************************************************
// External Flood Protection
log_ip("BA", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'balance_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'balance_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('balance_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'balance_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
while (1) {
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:balance.php

示例5: mysql_fetch_row

        $transaction_info;
        for ($i = 0; $i < $sql_num_results; $i++) {
            $sql_row = mysql_fetch_row($sql_result);
            $public_key_from = $sql_row[0];
            $public_key_to = $sql_row[1];
            $crypt3 = $sql_row[2];
            $attribute = $sql_row[3];
            if ($attribute == "G" && $public_key_from == $public_key_to) {
                // Decrypt transaction information
                if ($GLOBALS['decrypt_mode'] == 2) {
                    $rsa->loadKey($public_key_from);
                    $transaction_info = $rsa->decrypt(base64_decode($crypt3));
                } else {
                    $transaction_info = tk_decrypt($public_key_from, base64_decode($crypt3), TRUE);
                }
                $transaction_amount_sent = find_string("AMOUNT=", "---TIME", $transaction_info);
                $crypto_balance += $transaction_amount_sent;
            }
        }
        echo $crypto_balance;
    }
    // End Permission Check
    // Log inbound IP activity
    log_ip("AP", scale_trigger(100));
    exit;
}
//***********************************************************************************
//***********************************************************************************
// Log IP even when not using any functions, just in case
log_ip("AP", scale_trigger(10));
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:30,代码来源:api.php

示例6: log_ip

                echo "-----status=OK-----domain={$my_server_domain}-----subfolder={$my_server_subfolder}-----port_number={$my_server_port_number}-----";
            }
        } else {
            // Peer not allowed to connect (invalid type)
            echo "-----status=FAILED-----domain";
        }
    }
    // Full Server Check
    // Log inbound IP activity
    log_ip("PL", scale_trigger(200));
    exit;
}
//***********************************************************************************
//***********************************************************************************
// External Flood Protection
log_ip("PL", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'peerlist_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'peerlist_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('peerlist_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'peerlist_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
ini_set('user_agent', 'Timekoin Server (Peerlist) v' . TIMEKOIN_VERSION);
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:peerlist.php

示例7: intval

    exit;
}
//***********************************************************************************
//***********************************************************************************
// Answer block hash poll
if ($_GET["action"] == "block_hash" && $_GET["block_number"] >= 0) {
    $block_number = intval($_GET["block_number"]);
    echo mysql_result(mysql_query("SELECT hash FROM `transaction_foundation` WHERE `block` = {$block_number} LIMIT 1"), 0, 0);
    // Log inbound IP activity
    log_ip("FO", 1);
    exit;
}
//***********************************************************************************
//***********************************************************************************
// External Flood Protection
log_ip("FO", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'foundation_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'foundation_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('foundation_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'foundation_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
ini_set('default_socket_timeout', 3);
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:foundation.php

示例8: activate

                if ($fresh_system === FALSE) {
                    // Stop all other script activity until the user actually starts the system.
                    // This is useful when recoving from an unknown error or crash.
                    activate(TIMEKOINSYSTEM, 0);
                }
                // All match, set login variable and store username in cookie
                $_SESSION["login_username"] = $http_username;
                $_SESSION["valid_login"] = TRUE;
                header("Location: index.php?menu=home");
                exit;
            }
        }
        // Log invalid attempts
        write_log("Invalid Login from IP: " . $_SERVER['REMOTE_ADDR'] . " trying Username:[" . $http_username . "] with Password:[" . $http_password . "]", "GU");
    }
    log_ip("GU", scale_trigger(3));
    // Avoid flood-brute password guessing
    sleep(1);
    // One second delay to help prevent brute force attack
    login_screen("Login Failed");
    exit;
}
if ($_SESSION["valid_login"] == TRUE) {
    //****************************************************************************
    if (mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD) == FALSE) {
        home_screen('ERROR', '<font color="red"><strong>Could Not Connect To Database</strong></font>', '', '');
        exit;
    }
    if (mysql_select_db(MYSQL_DATABASE) == FALSE) {
        home_screen('ERROR', '<font color="red"><strong>Could Not Select Database</strong></font>', '', '');
        exit;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:index.php

示例9: mysql_fetch_array

    $queue_number = 1;
    if ($sql_num_results > 0) {
        for ($i = 0; $i < $sql_num_results; $i++) {
            $sql_row = mysql_fetch_array($sql_result);
            echo "-----public_key{$queue_number}=", base64_encode($sql_row["public_key"]), "-----join{$queue_number}=", $sql_row["join_peer_list"], "-----last{$queue_number}=", $sql_row["last_generation"], "-----ip{$queue_number}=", $sql_row["IP_Address"], "-----END{$queue_number}";
            $queue_number++;
        }
    }
    // Log inbound IP activity
    log_ip("GP", 1);
    exit;
}
//***********************************************************************************
//***********************************************************************************
// External Flood Protection
log_ip("GP", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'genpeer_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'genpeer_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('genpeer_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'genpeer_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
ini_set('user_agent', 'Timekoin Server (Genpeer) v' . TIMEKOIN_VERSION);
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:genpeer.php


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