Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Raven.config('http://blahblahblah@localhost:9000/2', { logger:'my-logger', whitelistUrls:[], ignoreErrors:[], includePaths:[] } ).install();
- Raven_Autoloader::register();
- $client = new Raven_Client('http://blahblahblah@localhost:9000/2', array('logger' => 'my-logger'));
- $error_handler = new Raven_ErrorHandler($client);
- set_error_handler(array($error_handler, 'handleError'));
- set_exception_handler(array($error_handler, 'handleException'));
- /**
- * Parses a Raven-compatible DSN and returns an array of its values.
- */
- public static function parseDSN($dsn)
- {
- $url = parse_url($dsn);
- $scheme = (isset($url['scheme']) ? $url['scheme'] : '');
- if (!in_array($scheme, array('http', 'https', 'udp'))) {
- throw new InvalidArgumentException('Unsupported Sentry DSN scheme: ' . (!empty($scheme) ? $scheme : '<not set>'));
- }
- $netloc = (isset($url['host']) ? $url['host'] : null);
- $netloc.= (isset($url['port']) ? ':'.$url['port'] : null);
- $rawpath = (isset($url['path']) ? $url['path'] : null);
- if ($rawpath) {
- $pos = strrpos($rawpath, '/', 1);
- if ($pos !== false) {
- $path = substr($rawpath, 0, $pos);
- $project = substr($rawpath, $pos + 1);
- } else {
- $path = '';
- $project = substr($rawpath, 1);
- }
- } else {
- $project = null;
- $path = '';
- }
- $username = (isset($url['user']) ? $url['user'] : null);
- $password = (isset($url['pass']) ? $url['pass'] : null);
- if (empty($netloc) || empty($project) || empty($username) || empty($password)) {
- throw new InvalidArgumentException('Invalid Sentry DSN: ' . $dsn);
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement