Free web space - Chapter 16: Command-Line PHP Utilities 589 $diskInfo =
Chapter 16: Command-Line PHP Utilities 589 $diskInfo = getDiskInfo($system->filesystems()); $alert = 0; foreach ($diskInfo as $mount => $currentPercent) { if (!empty($MAXSIZE[$mount]) && $MAXSIZE[$mount] <= $currentPercent ) { $alert++; $alertInfo[ /<%DISK_STATUS%>/ ] .= Filesystem: $mount exceeds limit. . Currently used: $currentPercent%n ; if (DEBUG) echo Filesystem: $mount exceeds limits.n ; } } if ($alert) sendAlert($alertInfo); exit; function sendAlert($info = null) { $lines = file($GLOBALS[ MAIL_TEMPLATE ]); $contentTypeSet = FALSE; $message = array(); $headers = array(); foreach ($lines as $str) { $index++; if (preg_match( /To:s*(.+)/i , $str, $match)) { $to = $match[1]; } else if (preg_match( /From:s*(.+)/i , $str, $match)) Continued