PHP code example of sandreu / cake-sentry

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

    

sandreu / 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
		'avoid_bot_scan_errors' => 'MissingController or MissingPlugin error message', // or false if you want Sentry to log MissingController and MissingPlugin Exceptions
		'User' => array(
			'model' => 'SpecialUser', // 'User' is default value
			'email_field' => 'special_email' // default checks 'email' and 'mail' fields
		),
		'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');