From: <ar...@us...> - 2012-01-24 08:15:31
|
Revision: 39635 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39635&view=rev Author: arildb Date: 2012-01-24 08:15:24 +0000 (Tue, 24 Jan 2012) Log Message: ----------- [FIX] Activating "Close site when server load is above the threshold (except for those with permission)" caused failures on Windows. The functionality uses the PHP5 function: sys_getloadavg(), which is not implemented for Windows. Modified Paths: -------------- branches/8.x/lib/setup/load_threshold.php Modified: branches/8.x/lib/setup/load_threshold.php =================================================================== --- branches/8.x/lib/setup/load_threshold.php 2012-01-23 22:37:59 UTC (rev 39634) +++ branches/8.x/lib/setup/load_threshold.php 2012-01-24 08:15:24 UTC (rev 39635) @@ -9,14 +9,16 @@ $access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__)); // get average server load in the last minute -$load = sys_getloadavg(); -$server_load = $load[0]; +if(function_exists('sys_getloadavg')) { + $load = sys_getloadavg(); + $server_load = $load[0]; -if ( $prefs['use_load_threshold'] == 'y' and $tiki_p_access_closed_site != 'y' and !isset($bypass_siteclose_check) ) { - if ( $server_load > $prefs['load_threshold'] ) { - $url = 'tiki-error_simple.php?error=' . urlencode($prefs['site_busy_msg']); - header('location: ' . $url); - exit; + if ( $prefs['use_load_threshold'] == 'y' and $tiki_p_access_closed_site != 'y' and !isset($bypass_siteclose_check) ) { + if ( $server_load > $prefs['load_threshold'] ) { + $url = 'tiki-error_simple.php?error=' . urlencode($prefs['site_busy_msg']); + header('location: ' . $url); + exit; + } } -} -$smarty->assign('server_load', $server_load == 0 ? '?' : $server_load); + $smarty->assign('server_load', $server_load == 0 ? '?' : $server_load); +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |