public static function error($msg)
{
phpCAS::traceBegin();
$dbg = debug_backtrace();
$function = '?';
$file = '?';
$line = '?';
if (is_array($dbg)) {
for ($i = 1; $i < sizeof($dbg); $i++) {
if (is_array($dbg[$i]) && isset($dbg[$i]['class'])) {
if ($dbg[$i]['class'] == __CLASS__) {
$function = $dbg[$i]['function'];
$file = $dbg[$i]['file'];
$line = $dbg[$i]['line'];
}
}
}
}
if (self::$_PHPCAS_VERBOSE) {
echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>" . __CLASS__ . "::" . $function . '(): ' . htmlentities($msg) . "</b></font> in <b>" . $file . "</b> on line <b>" . $line . "</b><br />\n";
} else {
echo "<br />\n<b>Error</b>: <font color=\"FF0000\"><b>" . DEFAULT_ERROR . "</b><br />\n";
}
phpCAS::trace($msg . ' in ' . $file . 'on line ' . $line);
phpCAS::traceEnd();
throw new CAS_GracefullTerminationException(__CLASS__ . "::" . $function . '(): ' . $msg);
}