Raygun4php
Mubashar
Posted on
Aug 28 2014
How we setup raygun4php ? I configured and run a test script but not firing exceptions to raygun. Here my code:
created autoload using composer.phar.
> <?php namespace {
>
> require_once 'vendor/autoload.php';
>
> $client = new \Raygun4php\RaygunClient("my api key");
>
> function error_handler($errno, $errstr, $errfile, $errline ) {
> global $client;
> $client->SendError($errno, $errstr, $errfile, $errline); }
>
> function exception_handler($exception) {
> global $client;
> $client->SendException($exception); }
> set_exception_handler('exception_handler'); set_error_handler("error_handler"); }
Setup Environments: Ubuntu 14.04/Chrome/php 5.5.9.1
Callum
Posted on
Aug 29 2014
Looks like you're missing underscores from the final two code lines - try:
set_error_handler("error_handler");
set_exception_handler('exception_handler');
Let us know if you still have issues after this.