1. Go to this page and download the library: Download v-six/silex-raven 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/ */
// Capture an error
$app['raven']->captureMessage('Oops !');
// Capture an exception
$app['raven']->captureException(new \Exception('Oops !'));
// Capture an exception with additional debug data
$app['raven']->captureException(new \Exception('Oops !'),
array(
'extra' => array(
'php_version' => phpversion()
),
)
);
// Bind the logged in user
$app['raven']->user_context(array('email' => '[email protected]'));
// Tag the request with something interesting
$app['raven']->tags_context(array('interesting' => 'yes'));
// Provide a bit of additional context
$app['raven']->extra_context(array('happiness' => 'very'));
// Clean all previously provided context
$app['raven']->context->clear();
$app = new Silex\Application();
$app->register(
new \SilexRaven\RavenServiceProvider(),
['raven.dsn' => 'http://public:[email protected]/1']
);
$app->error(function (\Exception $e, $code) use($app, $user) {
$app['raven']->user_context(array('email' => $user->email));
$app['raven']->captureException($e)
$app['raven']->context->clear();
return new Response("There is an error !");
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.