PHP code example of moriony / silex-sentry-provider

1. Go to this page and download the library: Download moriony/silex-sentry-provider library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

moriony / silex-sentry-provider example snippets


$app->register(new Moriony\Silex\Provider\SentryServiceProvider, array(
    'sentry.options' => array(
        'dsn' => 'http://public:[email protected]/1',
        // ... and other sentry options
    )
));

$app->error(function (\Exception $e, $code) use($app) {
    // ...
    $client = $app['sentry'];
    $client->captureException($e);
    // ...
});

// ...
$errorHandler = $app['sentry.error_handler'];
$errorHandler->registerExceptionHandler();
$errorHandler->registerErrorHandler();
$errorHandler->registerShutdownFunction();
// ...