本文整理汇总了PHP中wfUtils::showReadme方法的典型用法代码示例。如果您正苦于以下问题:PHP wfUtils::showReadme方法的具体用法?PHP wfUtils::showReadme怎么用?PHP wfUtils::showReadme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wfUtils
的用法示例。
在下文中一共展示了wfUtils::showReadme方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restoreReadmeForUpgrade
/**
* This is the only hook I see to tie into WP's core update process.
* Since we hide the readme.html to prevent the WordPress version from being discovered, it breaks the upgrade
* process because it cannot copy the previous readme.html.
*
* @param string $string
* @return string
*/
public static function restoreReadmeForUpgrade($string)
{
static $didRun;
if (!isset($didRun)) {
$didRun = true;
wfUtils::showReadme();
register_shutdown_function('wfUtils::hideReadme');
}
return $string;
}
示例2: ajax_saveConfig_callback
//.........这里部分代码省略.........
}
if (preg_match('/[a-zA-Z0-9\\d]+/', $opts['liveTraf_ignoreUA'])) {
$opts['liveTraf_ignoreUA'] = trim($opts['liveTraf_ignoreUA']);
} else {
$opts['liveTraf_ignoreUA'] = '';
}
if (!$opts['other_WFNet']) {
$wfdb = new wfDB();
global $wpdb;
$p = $wpdb->base_prefix;
$wfdb->queryWrite("delete from {$p}" . "wfBlocks where wfsn=1 and permanent=0");
}
if ($opts['howGetIPs'] != wfConfig::get('howGetIPs', '')) {
$reload = 'reload';
}
$regenerateHtaccess = false;
if (wfConfig::get('bannedURLs', false) != $opts['bannedURLs']) {
$regenerateHtaccess = true;
}
foreach ($opts as $key => $val) {
if ($key != 'apiKey') {
//Don't save API key yet
wfConfig::set($key, $val);
}
}
if ($regenerateHtaccess && wfConfig::get('cacheType') == 'falcon') {
wfCache::addHtaccessCode('add');
}
if ($opts['autoUpdate'] == '1') {
wfConfig::enableAutoUpdate();
} else {
if ($opts['autoUpdate'] == '0') {
wfConfig::disableAutoUpdate();
}
}
try {
if ($opts['disableCodeExecutionUploads']) {
wfConfig::disableCodeExecutionForUploads();
} else {
wfConfig::removeCodeExecutionProtectionForUploads();
}
} catch (wfConfigException $e) {
return array('errorMsg' => $e->getMessage());
}
if (!empty($opts['email_summary_enabled'])) {
wfConfig::set('email_summary_enabled', 1);
wfConfig::set('email_summary_interval', $opts['email_summary_interval']);
wfConfig::set('email_summary_excluded_directories', $opts['email_summary_excluded_directories']);
wfActivityReport::scheduleCronJob();
} else {
wfConfig::set('email_summary_enabled', 0);
wfActivityReport::disableCronJob();
}
if (wfConfig::get('other_hideWPVersion')) {
wfUtils::hideReadme();
} else {
wfUtils::showReadme();
}
$paidKeyMsg = false;
if (!$opts['apiKey']) {
//Empty API key (after trim above), then try to get one.
$api = new wfAPI('', wfUtils::getWPVersion());
try {
$keyData = $api->call('get_anon_api_key');
if ($keyData['ok'] && $keyData['apiKey']) {
wfConfig::set('apiKey', $keyData['apiKey']);
wfConfig::set('isPaid', 0);
$reload = 'reload';
} else {
throw new Exception("We could not understand the Wordfence server's response because it did not contain an 'ok' and 'apiKey' element.");
}
} catch (Exception $e) {
return array('errorMsg' => "Your options have been saved, but we encountered a problem. You left your API key blank, so we tried to get you a free API key from the Wordfence servers. However we encountered a problem fetching the free key: " . wp_kses($e->getMessage(), array()));
}
} else {
if ($opts['apiKey'] != wfConfig::get('apiKey')) {
$api = new wfAPI($opts['apiKey'], wfUtils::getWPVersion());
try {
$res = $api->call('check_api_key', array(), array());
if ($res['ok'] && isset($res['isPaid'])) {
wfConfig::set('apiKey', $opts['apiKey']);
$reload = 'reload';
wfConfig::set('isPaid', $res['isPaid']);
//res['isPaid'] is boolean coming back as JSON and turned back into PHP struct. Assuming JSON to PHP handles bools.
if ($res['isPaid']) {
$paidKeyMsg = true;
}
} else {
throw new Exception("We could not understand the Wordfence API server reply when updating your API key.");
}
} catch (Exception $e) {
return array('errorMsg' => "Your options have been saved. However we noticed you changed your API key and we tried to verify it with the Wordfence servers and received an error: " . wp_kses($e->getMessage(), array()));
}
} else {
$api = new wfAPI($opts['apiKey'], wfUtils::getWPVersion());
$api->call('ping_api_key', array(), array());
}
}
return array('ok' => 1, 'reload' => $reload, 'paidKeyMsg' => $paidKeyMsg);
}