Project

General

Profile

Bug #19609 ยป 9790.diff

Administrator Admin, 2008-11-13 16:29

View differences:

t3lib/class.gzip_encode.php (working copy)
* @return float Returns the current load average
*/
function linux_loadavg() {
$buffer = "0 0 0";
$f = fopen("/proc/loadavg","rb");
if (!feof($f)) {
$buffer = fgets($f, 1024);
$buffer = '0 0 0';
$f = @fopen('/proc/loadavg', 'rb');
if ($f) {
if (!feof($f)) {
$buffer = fgets($f, 1024);
}
fclose($f);
}
fclose($f);
$load = explode(" ",$buffer);
$load = explode(' ', $buffer);
return max((float)$load[0], (float)$load[1], (float)$load[2]);
}
    (1-1/1)