noone-silent / phalcon-sentry
Sentry integration for the Phalcon Framework
Installs: 2 320
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >= 8.0
- ext-phalcon: ^5.0
Requires (Dev)
- codeception/codeception: ^5.1.2
- codeception/module-phalcon5: ^v2.0.1
- friendsofphp/php-cs-fixer: ^3.58
- phalcon/ide-stubs: ^v5.0.0
- phpstan/phpstan: 1.10.*
- sentry/sentry: ^4.7
Suggests
- sentry/sentry: Use version 4.* for best compatility.
README
This directory contains the PHP source code for the Phalcon Sentry integration.
Requirements
- PHP 8.0 or higher
- Composer
- Phalcon Framework in version 5.0.0 or higher
Installation
composer require noone-silent/phalcon-sentry
Usage
Create a copy of the sentry configuration found under config/sentry.php
.
Tip
It is recommended, that you set your events manager before setting the service provider.
$di->set('eventsManager', new \Phalcon\Events\Manager(), true);
Add the following code to your entry script:
$di->register( new \Phalcon\Sentry\ServiceProvider( $pathTo . '/config/sentry.php' ) );
If you're using the Volt template engine, you can use the provided helper to place scripts and tags.
The name of sentryHelper
is configurable in config/sentry.php
.
// Add this between your <head></head> {{ sentryHelper.getMetaTag() }}
// Add this right before your </body> {{ sentryHelper.getScript() }}
You can also pass options to the getScript()
helper:
{{ sentryHelper.getScript( [ 'Sentry.browserTracingIntegration()', 'Sentry.replayIntegration()', 'Sentry.feedbackIntegration()' ], static_url('/js/bundle.tracing.replay.feedback.min.js') ) }}
Important
If you do not self-host the sentry browser script,
you should add browser.sentry-cdn.com
to your allowed script-src
.
You can read more about this here: Sentry Content Security Policy