public static function logError($errno, $errmsg, $filename, $linenum, $vars) { $errortype = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'Person Error', E_USER_WARNING => 'Person Warning', E_RECOVERABLE_ERROR => 'Catchable Fatal Error'); if (!array_key_exists($errno, $errortype)) { return; } $type = $errortype[$errno]; $dt = date("Y-m-d H:i:s (T)"); $id = Session::currentSUNetID(); $err = "[{$dt}|{$id}] {$type}: {$errmsg}, in {$filename} at line {$linenum}\n"; error_log($err, 3, self::ERROR_LOG_LOCATION); // shouldn't trigger this handler, but just in case if ($errno == E_PARSE || $errno == E_CORE_ERROR) { exit; } }
private function getLoginInfo() { $text = ''; if ($this->modal) { return $text; } $id = Session::currentSUNetID(); if (!$id) { return 'Not logged in.'; } $user = Session::currentPerson(); if (!$user) { return 'No account.'; } $text .= '<span class="loginname">' . $user->getDisplayName() . '</span>'; $pos = Session::defaultPosition(); $text .= "<br />\n" . Session::positionOrTeamName($pos); return $text; }