1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Switch to use sys_getloadavg()

This commit is contained in:
Rasmus Lerdorf
2006-02-18 05:44:33 +00:00
parent ff9f483703
commit ef33d9eeac

View File

@@ -5,8 +5,8 @@
/*
Offload to the visitor's nearest mirror if the load is too high.
The used getloadavg() function is currently only available on
the www.php.net machine.
The used sys_getloadavg() function is currently only available in
the latest PHP 5.1 versions
*/
@@ -16,12 +16,12 @@ function load_check()
global $COUNTRY, $MIRRORS;
// We cannot check the load here
if (!function_exists("getloadavg")) {
if (!function_exists("sys_getloadavg")) {
return;
}
// Get load and print it out in header
$load = getloadavg();
$load = sys_getloadavg();
header("X-PHP-Load: " . implode(", ", $load));
$load = $load[0];