PHP code example of snakano / cake-sentry

1. Go to this page and download the library: Download snakano/cake-sentry 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/ */

    

snakano / cake-sentry example snippets


	CakePlugin::load('Sentry');

	App::uses('SentryErrorHandler', 'Sentry.Lib');

	Configure::write('Sentry', array(
		'production_only' => false, // true is default value -> no error in sentry when debug
		'PHP' => array(
			'server'=>'http://your-sentry-DSN-for-PHP'
		),
		'javascript' => array(
			'server'=>'http://your-sentry-DSN-for-javascript'
		)
	));

	Configure::write('Error', array(
		'handler' => 'SentryErrorHandler::handleError',
		'level' => E_ALL & ~E_DEPRECATED,
		'trace' => true
	));

	Configure::write('Exception', array(
		'handler' => 'SentryErrorHandler::handleException',
		'renderer'=>'ExceptionRenderer'
	));

	CakeLog::config('default', array('engine' => 'Sentry.SentryLog'));

	
	echo $this->Html->script('jquery');
	echo $this->Html->script('ravenjs-min');