for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Health monitoring for Yii2 applications
*
* @link https://github.com/hiqdev/yii2-monitoring
* @package yii2-monitoring
* @license BSD-3-Clause
* @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
*/
namespace hiqdev\yii2\monitoring;
use Sentry\SentrySdk;
use Yii;
class Component extends \yii\base\Component
{
public function init()
if (!class_exists(SentrySdk::class)) {
return;
}
if (!empty(SentrySdk::getCurrentHub()->getClient())) {
$params = Yii::$app->params;
if (empty($params['sentry.dsn']) || empty($params['sentry.enabled'])) {
\Sentry\init(['dsn' => $params['sentry.dsn']]);