PHP code example of mezonix / sf-sentry-plugin
1. Go to this page and download the library: Download mezonix/sf-sentry-plugin 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/ */
mezonix / sf-sentry-plugin example snippets
# config/ProjectConfiguration.php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins(array(
// ...
'sfSentryPlugin',
));
}
}
// send debug message
Sentry::sendDebug('Debug message text');
// send information message
Sentry::sendInfo('Information message text');
// send warning message
Sentry::sendWarn('Warning message text');
// send error message
Sentry::sendError('Error message text');
// send error message with variables
Sentry::sendError('Error message text', array('foo' => 'bar'));
// send exception
Sentry::sendException(new Exception('Exception message'));
// send exception with variables
Sentry::sendException(new Exception('Exception message'), array('foo' => 'bar'));