當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wfConfig::get_ser方法代碼示例

本文整理匯總了PHP中wfConfig::get_ser方法的典型用法代碼示例。如果您正苦於以下問題:PHP wfConfig::get_ser方法的具體用法?PHP wfConfig::get_ser怎麽用?PHP wfConfig::get_ser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wfConfig的用法示例。


在下文中一共展示了wfConfig::get_ser方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

<table border="0">
<?php 
$lastAdminLogin = wfConfig::get_ser('lastAdminLogin', false);
if ($lastAdminLogin) {
    ?>
<tr><td style="padding-right: 20px;">Last Admin Username Login:</td><td>
<?php 
    echo '<strong>' . $lastAdminLogin['username'] . '</strong> [' . $lastAdminLogin['firstName'] . ' ' . $lastAdminLogin['lastName'] . ']</td></tr><tr style="padding-right: 20px;"><td>Last Admin Login Time</td><td>' . $lastAdminLogin['time'] . '</td></tr><tr><td style="padding-right: 20px;">Last Admin Login IP:</td><td>' . $lastAdminLogin['IP'] . '</td></tr>';
    ?>
</td></tr>
<?php 
}
if (wfConfig::get('firewallEnabled')) {
    ?>
<tr><td style="padding-right: 20px;">Firewall Enabled:</td><td style="color: #0F0;">&#10004;</td></tr> <?php 
}
if (wfConfig::get('loginSecurityEnabled')) {
    ?>
<tr><td style="padding-right: 20px;">Login Security Enabled:</td><td style="color: #0F0;">&#10004;</td></tr> <?php 
}
if (wfConfig::get('other_scanComments')) {
    ?>
<tr><td style="padding-right: 20px;">Comment Filter Enabled:</td><td style="color: #0F0;">&#10004;</td></tr> <?php 
}
if (wfConfig::get('other_hideWPVersion')) {
    ?>
<tr><td style="padding-right: 20px;">WordPress Version Hiding Enabled:</td><td style="color: #0F0;">&#10004;</td></tr> <?php 
}
if (wfConfig::get('other_pwStrengthOnUpdate')) {
    ?>
開發者ID:HandsomeDogStudio,項目名稱:peanutbutterplan,代碼行數:30,代碼來源:dashboard.php

示例2: export_settings

 public function export_settings()
 {
     /** @var wpdb $wpdb */
     global $wpdb;
     $keys = wfConfig::getExportableOptionsKeys();
     $export = array();
     foreach ($keys as $key) {
         $export[$key] = wfConfig::get($key, '');
     }
     $export['scanScheduleJSON'] = json_encode(wfConfig::get_ser('scanSched', array()));
     $export['schedMode'] = wfConfig::get('schedMode', '');
     // Any user supplied blocked IPs.
     $export['_blockedIPs'] = $wpdb->get_results('SELECT *, HEX(IP) as IP FROM ' . $wpdb->base_prefix . 'wfBlocks WHERE wfsn = 0 AND permanent = 1');
     // Any advanced blocking stuff too.
     $export['_advancedBlocking'] = $wpdb->get_results('SELECT * FROM ' . $wpdb->base_prefix . 'wfBlocksAdv');
     try {
         $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
         $res = $api->call('export_options', array(), $export);
         if ($res['ok'] && $res['token']) {
             return array('ok' => 1, 'token' => $res['token']);
         } else {
             throw new Exception("Invalid response: " . var_export($res, true));
         }
     } catch (Exception $e) {
         return array('errorExport' => "An error occurred: " . $e->getMessage());
     }
 }
開發者ID:jexmex,項目名稱:mainwp-child,代碼行數:27,代碼來源:class-mainwp-child-wordfence.php

示例3: statusEndErr

 public static function statusEndErr()
 {
     $statusStartMsgs = wfConfig::get_ser('wfStatusStartMsgs', array());
     for ($i = 0; $i < sizeof($statusStartMsgs); $i++) {
         if (empty($statusStartMsgs[$i]) === false) {
             self::status(10, 'info', 'SUM_ENDERR:' . $statusStartMsgs[$i]);
             $statusStartMsgs[$i] = '';
         }
     }
 }
開發者ID:ashenkar,項目名稱:sanga,代碼行數:10,代碼來源:wordfenceClass.php

示例4: getLoggedAdmins

 public function getLoggedAdmins()
 {
     $loggedAdmins = wfConfig::get_ser('adminUserList', false);
     if (!is_array($loggedAdmins)) {
         $this->createInitialList();
         $loggedAdmins = wfConfig::get_ser('adminUserList', false);
     }
     if (!is_array($loggedAdmins)) {
         $loggedAdmins = array();
     }
     return $loggedAdmins;
 }
開發者ID:ashenkar,項目名稱:sanga,代碼行數:12,代碼來源:wfLog.php

示例5: array

?>
>Manually schedule scans using calendar below</option>
				</select>
		<p>
			<strong>Shortcuts</strong>:
			<a href="#" onclick="WFAD.sched_shortcut('onceDaily'); return false;">Once a day</a>,
			<a href="#" onclick="WFAD.sched_shortcut('twiceDaily'); return false;">Twice a day</a>,
			<a href="#" onclick="WFAD.sched_shortcut('weekends'); return false;">Weekends</a>,
			<a href="#" onclick="WFAD.sched_shortcut('oddDaysWE'); return false;">Odd days and weekends</a>,
			<a href="#" onclick="WFAD.sched_shortcut('every6hours'); return false;">Every 6 hours</a>,
		</p>

		<table border="0">
		<?php 
$daysOfWeek = array(array(1, 'Monday'), array(2, 'Tuesday'), array(3, 'Wednesday'), array(4, 'Thursday'), array(5, 'Friday'), array(6, 'Saturday'), array(0, 'Sunday'));
$sched = wfConfig::get_ser('scanSched', array());
foreach ($daysOfWeek as $elem) {
    $dayIndex = $elem[0];
    $dayName = $elem[1];
    require 'schedWeekEntry.php';
}
?>
		</table>
		<table border="0" cellpadding="0" cellspacing="0"><tr>
			<td>
				<input type="button" name="but3" class="button-primary" value="Save Scan Schedule" onclick="WFAD.sched_save();" />
			</td>
			<td style="height: 24px;"><div class="wfAjax24"></div><span class="wfSavedMsg">&nbsp;Your changes have been saved!</span></td>
		</tr>
		</table>
	</div>
開發者ID:ashenkar,項目名稱:sanga,代碼行數:31,代碼來源:menu_scanSchedule.php

示例6: 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

示例7: wfScanMain

 public static function wfScanMain()
 {
     self::$peakMemAtStart = memory_get_peak_usage();
     $db = new wfDB();
     if ($db->errorMsg) {
         self::errorExit("Could not connect to database to start scan: " . $db->errorMsg);
     }
     if (!wordfence::wfSchemaExists()) {
         self::errorExit("Looks like the Wordfence database tables have been deleted. You can fix this by de-activating and re-activating the Wordfence plugin from your Plugins menu.");
     }
     if (isset($_GET['test']) && $_GET['test'] == '1') {
         echo "WFCRONTESTOK:" . wfConfig::get('cronTestID');
         self::status(4, 'info', "Cron test received and message printed");
         exit;
     }
     /* ----------Starting cronkey check -------- */
     self::status(4, 'info', "Scan engine received request.");
     self::status(4, 'info', "Checking cronkey");
     if (!$_GET['cronKey']) {
         self::status(4, 'error', "Wordfence scan script accessed directly, or WF did not receive a cronkey.");
         echo "If you see this message it means Wordfence is working correctly. You should not access this URL directly. It is part of the Wordfence security plugin and is designed for internal use only.";
         exit;
     }
     self::status(4, 'info', "Fetching stored cronkey for comparison.");
     $currentCronKey = wfConfig::get('currentCronKey', false);
     wfConfig::set('currentCronKey', '');
     if (!$currentCronKey) {
         wordfence::status(4, 'error', "Wordfence could not find a saved cron key to start the scan so assuming it started and exiting.");
         exit;
     }
     self::status(4, 'info', "Exploding stored cronkey");
     $savedKey = explode(',', $currentCronKey);
     if (time() - $savedKey[0] > 86400) {
         self::errorExit("The key used to start a scan expired. The value is: " . $savedKey[0] . " and split is: " . $currentCronKey . " and time is: " . time());
     }
     //keys only last 60 seconds and are used within milliseconds of creation
     self::status(4, 'info', "Checking saved cronkey against cronkey param");
     if ($savedKey[1] != $_GET['cronKey']) {
         self::errorExit("Wordfence could not start a scan because the cron key does not match the saved key.");
     }
     /* --------- end cronkey check ---------- */
     self::status(4, 'info', "Becoming admin for scan");
     self::becomeAdmin();
     self::status(4, 'info', "Done become admin");
     $isFork = $_GET['isFork'] == '1' ? true : false;
     if (!$isFork) {
         self::status(4, 'info', "Checking if scan is already running");
         if (!wfUtils::getScanLock()) {
             self::errorExit("There is already a scan running.");
         }
     }
     self::status(4, 'info', "Requesting max memory");
     wfUtils::requestMaxMemory();
     self::status(4, 'info', "Setting up error handling environment");
     set_error_handler('wfScan::error_handler', E_ALL);
     register_shutdown_function('wfScan::shutdown');
     if (!self::$debugMode) {
         ob_start('wfScan::obHandler');
     }
     @error_reporting(E_ALL);
     wfUtils::iniSet('display_errors', 'On');
     self::status(4, 'info', "Setting up scanRunning and starting scan");
     $scan = false;
     if ($isFork) {
         $scan = wfConfig::get_ser('wfsd_engine', false, true);
         if ($scan) {
             self::status(4, 'info', "Got a true deserialized value back from 'wfsd_engine' with type: " . gettype($scan));
             wfConfig::set('wfsd_engine', '', true);
         } else {
             self::status(2, 'error', "Scan can't continue - stored data not found after a fork. Got type: " . gettype($scan));
             wfConfig::set('wfsd_engine', '', true);
             exit;
         }
     } else {
         wordfence::statusPrep();
         //Re-initializes all status counters
         $scan = new wfScanEngine();
     }
     try {
         $scan->go();
     } catch (Exception $e) {
         wfUtils::clearScanLock();
         self::status(2, 'error', "Scan terminated with error: " . $e->getMessage());
         self::status(10, 'info', "SUM_KILLED:Previous scan terminated with an error. See below.");
         exit;
     }
     wfUtils::clearScanLock();
     self::logPeakMemory();
     self::status(2, 'info', "Wordfence used " . sprintf('%.2f', (wfConfig::get('wfPeakMemory') - self::$peakMemAtStart) / 1024 / 1024) . "MB of memory for scan. Server peak memory usage was: " . sprintf('%.2f', wfConfig::get('wfPeakMemory') / 1024 / 1024) . "MB");
 }
開發者ID:roycocup,項目名稱:enclothed,代碼行數:90,代碼來源:wfScan.php


注:本文中的wfConfig::get_ser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。