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


PHP wfUtils::requestDetectProxyCallback方法代码示例

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


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

示例1: runInstall


//.........这里部分代码省略.........
        // Fix the data in the country column.
        // TODO: add version check so this doesn't run on every update.
        $ip_results = $wpdb->get_results("SELECT * FROM `{$prefix}wfBlockedIPLog` GROUP BY IP");
        if ($ip_results) {
            foreach ($ip_results as $ip_row) {
                $wpdb->query($wpdb->prepare("UPDATE `{$prefix}wfBlockedIPLog` SET countryCode = %s WHERE IP = %s", wfUtils::IP2Country(wfUtils::inet_ntop($ip_row->IP)), $ip_row->IP));
            }
        }
        if (wfConfig::get('other_hideWPVersion')) {
            wfUtils::hideReadme();
        }
        $colsFor610 = array('attackLogTime' => '`attackLogTime` double(17,6) unsigned NOT NULL AFTER `id`', 'statusCode' => '`statusCode` int(11) NOT NULL DEFAULT 0 AFTER `jsRun`', 'action' => "`action` varchar(64) NOT NULL DEFAULT '' AFTER `UA`", 'actionDescription' => '`actionDescription` text AFTER `action`', 'actionData' => '`actionData` text AFTER `actionDescription`');
        $hitTable = $wpdb->base_prefix . 'wfHits';
        foreach ($colsFor610 as $col => $colDefintion) {
            $count = $wpdb->get_col($wpdb->prepare(<<<SQL
SELECT * FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA=DATABASE()
AND COLUMN_NAME=%s
AND TABLE_NAME=%s
SQL
, $col, $hitTable));
            if (!$count) {
                $wpdb->query("ALTER TABLE {$hitTable} ADD COLUMN {$colDefintion}");
            }
        }
        $has404 = $wpdb->get_col($wpdb->prepare(<<<SQL
SELECT * FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA=DATABASE()
AND COLUMN_NAME='is404'
AND TABLE_NAME=%s
SQL
, $hitTable));
        if ($has404) {
            $wpdb->query(<<<SQL
UPDATE {$hitTable}
SET statusCode= CASE
WHEN is404=1 THEN 404
ELSE 200
END
SQL
);
            $wpdb->query("ALTER TABLE {$hitTable} DROP COLUMN `is404`");
        }
        $loginsTable = "{$wpdb->base_prefix}wfLogins";
        $hasHitID = $wpdb->get_col($wpdb->prepare(<<<SQL
SELECT * FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA=DATABASE()
AND COLUMN_NAME='hitID'
AND TABLE_NAME=%s
SQL
, $loginsTable));
        if (!$hasHitID) {
            $wpdb->query("ALTER TABLE {$loginsTable} ADD COLUMN hitID int(11) DEFAULT NULL AFTER `id`, ADD INDEX(hitID)");
        }
        if (!WFWAF_SUBDIRECTORY_INSTALL) {
            wfWAFConfig::set('wafDisabled', false);
        }
        // Call this before creating the index in cases where the wp-cron isn't running.
        self::trimWfHits();
        $hitsTable = "{$wpdb->base_prefix}wfHits";
        $hasAttackLogTimeIndex = $wpdb->get_var($wpdb->prepare(<<<SQL
SELECT COLUMN_KEY FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = %s
AND COLUMN_NAME = 'attackLogTime'
SQL
, $hitsTable));
        if (!$hasAttackLogTimeIndex) {
            $wpdb->query("ALTER TABLE {$hitsTable} ADD INDEX `attackLogTime` (`attackLogTime`)");
        }
        //6.1.16
        $allowed404s = wfConfig::get('allowed404s', '');
        if (!wfConfig::get('allowed404s6116Migration', false)) {
            if (!preg_match('/(?:^|\\b)browserconfig\\.xml(?:\\b|$)/i', $allowed404s)) {
                if (strlen($allowed404s) > 0) {
                    $allowed404s .= "\n";
                }
                $allowed404s .= "/browserconfig.xml";
                wfConfig::set('allowed404s', $allowed404s);
            }
            wfConfig::set('allowed404s6116Migration', 1);
        }
        if (wfConfig::get('email_summary_interval') == 'biweekly') {
            wfConfig::set('email_summary_interval', 'weekly');
        }
        //6.2.0
        wfConfig::migrateCodeExecutionForUploadsPHP7();
        //6.2.1
        if ((wfConfig::get('cacheType') == 'php' || wfConfig::get('cacheType') == 'falcon') && !wfConfig::get('wf621HadFalconEnabled')) {
            wfConfig::set('wf621HadFalconEnabled', true);
            wp_schedule_single_event(time(), 'wordfence_sendFalconDeprecationNotice');
        }
        //6.2.3
        if (!WFWAF_SUBDIRECTORY_INSTALL && class_exists('wfWAFIPBlocksController')) {
            wfWAFIPBlocksController::synchronizeConfigSettings();
        }
        //Check the How does Wordfence get IPs setting
        wfUtils::requestDetectProxyCallback();
        //Must be the final line
    }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:wordfenceClass.php

示例2: scan_checkHowGetIPs_init

 private function scan_checkHowGetIPs_init()
 {
     if (wfConfig::get('scansEnabled_checkHowGetIPs')) {
         $this->statusIDX['checkHowGetIPs'] = wordfence::statusStart("Checking for the most secure way to get IPs");
         $this->checkHowGetIPsRequestTime = time();
         wfUtils::requestDetectProxyCallback();
     } else {
         wordfence::statusDisabled("Skipping scan for misconfigured How does Wordfence get IPs");
     }
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:10,代码来源:wfScanEngine.php


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