{ "html": "
There are various ways to install the PHP integration for Sentry. The\nrecommended way is to use Composer:
\n$ composer require "sentry/sentry"\n
Alternatively you can manually install it:
\nDownload and extract the latest sentry-php archive\nto your PHP project.
\nRequire the autoloader in your application:
\nrequire_once '/path/to/Raven/library/Raven/Autoloader.php';\nRaven_Autoloader::register();\n
The most important part is the creation of the raven client. Create it\nonce and reference it from anywhere you want to interface with Sentry:
\n$client = new Raven_Client('___DSN___');\n
Once you have the client you can either use it manually or enable the\nautomatic error and exception capturing which is recommended:
\n$error_handler = new Raven_ErrorHandler($client);\n$error_handler->registerExceptionHandler();\n$error_handler->registerErrorHandler();\n$error_handler->registerShutdownFunction();\n
Sentry includes basic functionality for reporting any uncaught\nexceptions or PHP errors. This is done via the error handler,\nand appropriate hooks for each of PHP’s built-in reporting:
\n$error_handler = new Raven_ErrorHandler($sentryClient);\n$error_handler->registerExceptionHandler();\n$error_handler->registerErrorHandler();\n$error_handler->registerShutdownFunction();\n
Note
\nCalling install()
on a Raven_Client instance will automatically\nregister these handlers.