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


PHP wfConfig::set_ser方法代码示例

本文整理汇总了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;
 }
开发者ID:jexmex,项目名称:mainwp-child,代码行数:23,代码来源:class-mainwp-child-wordfence.php

示例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);
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:19,代码来源:wordfenceClass.php

示例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);
     }
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:11,代码来源:wfLog.php

示例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);
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:10,代码来源:wfScanEngine.php

示例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);
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:30,代码来源:wfIssues.php


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