function server_busy($numer){ if (PHP_OS == 'Linux' AND @file_exists('/proc/loadavg') AND $filestuff =@file_get_contents('/proc/loadavg')){ $loadavg = explode(' ', $filestuff); if (trim($loadavg[0]) > $numer) { print 'server busy, Please wait….'; exit(0); } } } $srv = server_busy('5.00'); ?>
<?php function server_busy($numer){ if (PHP_OS == 'Linux' AND @file_exists('/proc/loadavg') AND $filestuff =@file_get_contents('/proc/loadavg')){ $loadavg = explode(' ', $filestuff); if (trim($loadavg[0]) > $numer) { echo 'server busy, Please wait.'; exit(0); } # :D EBUG # else { # echo "OK"; #} return trim($loadavg[0]; } } $srv = server_busy('1.00'); ?>
shilo (8 Мая 2013 / 10:00) <?php function server_busy($numer){ if (PHP_OS == 'Linux' AND @file_exists('/proc/loadavg') AND $filestuff =@file_get_contents('/proc/loadavg')){ $loadavg = explode(' ', $filestuff); if (trim($loadavg[0]) > $numer) { echo 'server busy, Please wait.'; exit(0); } # :D EBUG # else { # echo "OK"; #} return trim($loadavg[0]; } } $srv = server_busy('1.00'); ?>