summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorChristian Schneider2007-10-12 13:33:22 +0000
committerChristian Schneider2007-10-12 13:33:22 +0000
commit909d7599edc95419dac9641f0df28c13f97266bb (patch)
tree610215f121c556c42a68dde4b19ebb127c9dd85c /it.class
parent9ed2fbbdc49f835578b25aa9ad369d287e7a6236 (diff)
downloaditools-909d7599edc95419dac9641f0df28c13f97266bb.tar.gz
itools-909d7599edc95419dac9641f0df28c13f97266bb.tar.bz2
itools-909d7599edc95419dac9641f0df28c13f97266bb.zip
Add title to mail body and do not send email if stdout is a tty
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it.class b/it.class
index 0429caf..9d90772 100644
--- a/it.class
+++ b/it.class
@@ -150,7 +150,7 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate
'blockmail' => 3600,
);
- $toscreen = ini_get('display_errors') || EDC('astwin') || EDC('asdevel');
+ $toscreen = ini_get('display_errors') || posix_isatty(STDOUT) || EDC('astwin') || EDC('asdevel');
if (!$toscreen) # this error can only be sent by mail: find out if we want to suppress it
{
@mkdir("/tmp/alertdata");
@@ -185,7 +185,7 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate
{
$trace = it_debug::backtrace($p['backtraceskip']); # moved in here for performance in mass error case
- $body = ($body ? trim($body)."\n\n" : "") . ($url && !$toscreen? "Url: $url\n\n" : "") . ($trace ? ($sendmail?"" :" ")."Trace: $trace\n\n" : "");
+ $body = ($body ? trim($body)."\n\n" : "") . ($url && !$toscreen? "{$p['title']}\n\nUrl: $url\n\n" : "") . ($trace ? ($sendmail?"" :" ")."Trace: $trace\n\n" : "");
if ($sendmail) # we're mailing: send maximum info
{