本文整理汇总了PHP中wfConfig::set_ser方法的典型用法代码示例。如果您正苦于以下问题:PHP wfConfig::set_ser方法的具体用法?PHP wfConfig::set_ser怎么用?PHP wfConfig::set_ser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wfConfig
的用法示例。
在下文中一共展示了wfConfig::set_ser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: downgrade_license
public function downgrade_license()
{
$api = new wfAPI('', wfUtils::getWPVersion());
$return = array();
try {
$keyData = $api->call('get_anon_api_key');
if ($keyData['ok'] && $keyData['apiKey']) {
wfConfig::set('apiKey', $keyData['apiKey']);
wfConfig::set('isPaid', 0);
$return['apiKey'] = $keyData['apiKey'];
$return['isPaid'] = 0;
//When downgrading we must disable all two factor authentication because it can lock an admin out if we don't.
wfConfig::set_ser('twoFactorUsers', array());
} else {
throw new Exception('Could not understand the response we received from the Wordfence servers when applying for a free API key.');
}
} catch (Exception $e) {
$return['errorMsg'] = 'Could not fetch free API key from Wordfence: ' . htmlentities($e->getMessage());
return $return;
}
$return['ok'] = 1;
return $return;
}
示例2: statusEnd
public static function statusEnd($idx, $haveIssues, $successFailed = false)
{
$statusStartMsgs = wfConfig::get_ser('wfStatusStartMsgs', array());
if ($haveIssues) {
if ($successFailed) {
self::status(10, 'info', 'SUM_ENDFAILED:' . $statusStartMsgs[$idx]);
} else {
self::status(10, 'info', 'SUM_ENDBAD:' . $statusStartMsgs[$idx]);
}
} else {
if ($successFailed) {
self::status(10, 'info', 'SUM_ENDSUCCESS:' . $statusStartMsgs[$idx]);
} else {
self::status(10, 'info', 'SUM_ENDOK:' . $statusStartMsgs[$idx]);
}
}
$statusStartMsgs[$idx] = '';
wfConfig::set_ser('wfStatusStartMsgs', $statusStartMsgs);
}
示例3: removeAdmin
/**
* @param int $userID
*/
public function removeAdmin($userID)
{
$loggedAdmins = $this->getLoggedAdmins();
if (array_key_exists($userID, $loggedAdmins) && !array_key_exists($userID, $this->getCurrentAdmins())) {
unset($loggedAdmins[$userID]);
wfConfig::set_ser('adminUserList', $loggedAdmins);
}
}
示例4: fork
public function fork()
{
wordfence::status(4, 'info', "Entered fork()");
if (wfConfig::set_ser('wfsd_engine', $this, true)) {
wordfence::status(4, 'info', "Calling startScan(true)");
self::startScan(true);
}
//Otherwise there was an error so don't start another scan.
exit(0);
}
示例5: updateSummaryItems
private function updateSummaryItems()
{
global $wpdb;
$dat = array();
$users = $wpdb->get_col("SELECT {$wpdb->users}.ID FROM {$wpdb->users}");
$dat['totalUsers'] = sizeof($users);
$res1 = $wpdb->get_col("SELECT count(*) as cnt FROM {$wpdb->posts} where post_type='page' and post_status NOT IN ('auto-draft')");
$dat['totalPages'] = $res1['0'];
$res1 = $wpdb->get_col("SELECT count(*) as cnt FROM {$wpdb->posts} where post_type='post' and post_status NOT IN ('auto-draft')");
$dat['totalPosts'] = $res1['0'];
$res1 = $wpdb->get_col("SELECT count(*) as cnt FROM {$wpdb->comments}");
$dat['totalComments'] = $res1['0'];
$res1 = $wpdb->get_col("SELECT count(*) as cnt FROM {$wpdb->term_taxonomy} where taxonomy='category'");
$dat['totalCategories'] = $res1['0'];
$res1 = $wpdb->get_col("show tables");
$dat['totalTables'] = sizeof($res1);
$totalRows = 0;
foreach ($res1 as $table) {
$res2 = $wpdb->get_col("select count(*) from `{$table}`");
if (isset($res2[0])) {
$totalRows += $res2[0];
}
}
$dat['totalRows'] = $totalRows;
$arr = wfConfig::get_ser('wf_summaryItems', array());
foreach ($dat as $key => $val) {
$arr[$key] = $val;
}
wfConfig::set_ser('wf_summaryItems', $arr);
}