function SimpleSAML_exception_handler(Exception $exception) { if ($exception instanceof SimpleSAML_Error_Error) { $exception->show(); } else { $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception); $e->show(); } }
function SimpleSAML_exception_handler($exception) { SimpleSAML\Module::callHooks('exception_handler', $exception); if ($exception instanceof SimpleSAML_Error_Error) { $exception->show(); } elseif ($exception instanceof Exception) { $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception); $e->show(); } else { if (class_exists('Error') && $exception instanceof Error) { $code = $exception->getCode(); $errno = $code > 0 ? $code : E_ERROR; $errstr = $exception->getMessage(); $errfile = $exception->getFile(); $errline = $exception->getLine(); SimpleSAML_error_handler($errno, $errstr, $errfile, $errline); } } }
if (array_key_exists($type, $mimeTypes)) { $contentType = $mimeTypes[$type]; } } if ($contentType === null) { /* We were unable to determine the MIME type from the file extension. Fall back to mime_content_type (if it * exists). */ if (function_exists('mime_content_type')) { $contentType = mime_content_type($path); } else { // mime_content_type doesn't exist. Return a default MIME type SimpleSAML_Logger::warning('Unable to determine mime content type of file: ' . $path); $contentType = 'application/octet-stream'; } } $contentLength = sprintf('%u', filesize($path)); // force filesize to an unsigned number header('Content-Type: ' . $contentType); header('Content-Length: ' . $contentLength); header('Cache-Control: public,max-age=86400'); header('Expires: ' . gmdate('D, j M Y H:i:s \\G\\M\\T', time() + 10 * 60)); header('Last-Modified: ' . gmdate('D, j M Y H:i:s \\G\\M\\T', filemtime($path))); readfile($path); exit; } catch (SimpleSAML_Error_Error $e) { $e->show(); } catch (Exception $e) { $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $e); $e->show(); }
function SimpleSAML_exception_handler(Exception $exception) { $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception); $e->show(); }