本文整理汇总了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
}
示例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");
}
}