Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Raven is a PHP client for Sentry (getsentry.com)
PHP Makefile

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Raven
test
.gitignore
.travis.yml
AUTHORS
LICENSE
README.rst
composer.json
phpunit.xml.dist

README.rst

raven-php

https://secure.travis-ci.org/getsentry/raven-php.png?branch=master

raven-php is an experimental PHP client for Sentry.

// Instantiate a new client with a compatible DSN
$client = new Raven_Client('http://public:secret@example.com/1');

// Capture a message
$event_id = $client->getIdent($client->captureMessage('my log message'));

// Capture an exception
$event_id = $client->getIdent($client->captureException($ex));

// Give the user feedback
echo "Sorry, there was an error!";
echo "Your reference ID is " . $event_id;

// Install error handlers
$error_handler = new Raven_ErrorHandler($client);
set_error_handler(array($error_handler, 'handleError');
set_exception_handler(array($error_handler, 'handleException'));

Installation

Install with Composer

If you're using Composer to manage dependencies, you can add Raven with it.

{
    "require": {
        "raven/raven": ">=0.2.0"
    }
}

or to get the latest version off the master branch:

{
    "require": {
        "raven/raven": "dev-master"
    }
}

Install source from GitHub

To install the source code:

$ git clone git://github.com/getsentry/raven-php.git

And include it in your scripts:

require_once '/path/to/Raven/library/Raven.php';

Or, alternatively use the autoloader:

require_once '/path/to/Raven/library/Raven/Autoloader.php';
Raven_Autoloader::register();

Or, if you're using Composer:

require_once 'vendor/autoload.php';

Resources

Something went wrong with that request. Please try again.