本文整理汇总了PHP中ipsRegistry::server_load方法的典型用法代码示例。如果您正苦于以下问题:PHP ipsRegistry::server_load方法的具体用法?PHP ipsRegistry::server_load怎么用?PHP ipsRegistry::server_load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipsRegistry
的用法示例。
在下文中一共展示了ipsRegistry::server_load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: core_initiate
/**
* initiate
* Function to do global stuff
*
* @return @e void
*/
public function core_initiate()
{
//-----------------------------------------
// Server load
//-----------------------------------------
if (!ipsRegistry::$server_load) {
ipsRegistry::$server_load = '--';
}
if (strpos(strtolower(PHP_OS), 'win') === 0) {
ipsRegistry::$server_load = ipsRegistry::$server_load . '%';
}
//-----------------------------------------
// Set up defaults
//-----------------------------------------
$this->memberData['msg_count_new'] = !empty($this->memberData['msg_count_new']) ? intval($this->memberData['msg_count_new']) : 0;
$this->memberData['msg_count_total'] = !empty($this->memberData['msg_count_total']) ? intval($this->memberData['msg_count_total']) : 0;
}
示例2: init
//.........这里部分代码省略.........
/* Are we banned: Via IP Address? */
if (IPSMember::isBanned('ipAddress', self::$handles['member']->ip_address) === TRUE) {
self::instance()->getClass('output')->showError('you_are_banned', 2000, true, null, 403);
}
/* Are we banned: By DB */
if (self::$handles['member']->getProperty('member_banned') == 1 or self::$handles['member']->getProperty('temp_ban')) {
/* Don't show this message if we're viewing the warn log */
if (ipsRegistry::$request['module'] != 'ajax' or ipsRegistry::$request['section'] != 'warnings') {
self::getClass('class_localization')->loadLanguageFile('public_error', 'core');
$message = '';
if (self::$handles['member']->getProperty('member_banned')) {
$message = self::getClass('class_localization')->words['no_view_board_b'];
} else {
$ban_arr = IPSMember::processBanEntry(self::$handles['member']->getProperty('temp_ban'));
/* No longer banned */
if (time() >= $ban_arr['date_end']) {
self::DB()->update('members', array('temp_ban' => ''), 'member_id=' . self::$handles['member']->getProperty('member_id'));
} else {
$message = sprintf(self::getClass('class_localization')->words['account_susp'], self::getClass('class_localization')->getDate($ban_arr['date_end'], 'LONG', 1));
}
}
/* Get anything? */
if ($message) {
$warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => 'wl_member=' . self::$handles['member']->getProperty('member_id') . ' AND wl_suspend<>0 AND wl_suspend<>-2', 'order' => 'wl_date DESC', 'limit' => 1));
if ($warn['wl_id'] and ipsRegistry::$settings['warn_show_own']) {
$moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} );'>" . self::getClass('class_localization')->words['warnings_moreinfo'] . "</a>";
}
self::instance()->getClass('output')->showError("{$message} {$moredetails}", 1001, true, null, 403);
}
}
}
/* Check server load */
if (ipsRegistry::$settings['load_limit'] > 0) {
$server_load = IPSDebug::getServerLoad();
if ($server_load) {
$loadinfo = explode("-", $server_load);
if (count($loadinfo)) {
self::$server_load = $loadinfo[0];
if (self::$server_load > ipsRegistry::$settings['load_limit']) {
self::instance()->getClass('output')->showError('server_too_busy', 2001);
}
}
}
}
/* Specific Ajax Check */
if (IPS_IS_AJAX and ipsRegistry::$request['section'] != 'warnings') {
if (self::$handles['member']->getProperty('g_view_board') != 1 || ipsRegistry::$settings['board_offline'] && !self::$handles['member']->getProperty('g_access_offline')) {
@header("Content-type: application/json;charset=" . IPS_DOC_CHAR_SET);
print json_encode(array('error' => 'no_permission', '__board_offline__' => 1));
exit;
}
}
/* Other public check */
if (IPB_THIS_SCRIPT == 'public' and IPS_ENFORCE_ACCESS === FALSE and (ipsRegistry::$request['section'] != 'login' and ipsRegistry::$request['section'] != 'lostpass' and IPS_IS_AJAX === FALSE and ipsRegistry::$request['section'] != 'rss' and ipsRegistry::$request['section'] != 'attach' and ipsRegistry::$request['module'] != 'task' and ipsRegistry::$request['section'] != 'captcha')) {
//-----------------------------------------
// Permission to see the board?
//-----------------------------------------
if (self::$handles['member']->getProperty('g_view_board') != 1) {
self::getClass('output')->showError('no_view_board', 1000, null, null, 403);
}
//--------------------------------
// Is the board offline?
//--------------------------------
if (ipsRegistry::$settings['board_offline'] == 1 and !IPS_IS_SHELL) {
if (self::$handles['member']->getProperty('g_access_offline') != 1) {
ipsRegistry::$settings['no_reg'] = 1;