diff --git a/autocompletion.php b/autocompletion.php index 1d99674..f91608c 100644 --- a/autocompletion.php +++ b/autocompletion.php @@ -21,6 +21,7 @@ class Yii extends \yii\BaseYii { * @property \common\components\RabbitMQ\Component $amqp * @property \GuzzleHttp\Client $guzzle * @property \common\components\EmailRenderer $emailRenderer + * @property \mito\sentry\Component $sentry */ abstract class BaseApplication extends yii\base\Application { } diff --git a/common/components/Sentry/Component.php b/common/components/Sentry/Component.php new file mode 100644 index 0000000..ce0b1c5 --- /dev/null +++ b/common/components/Sentry/Component.php @@ -0,0 +1,18 @@ +client) && !isset($this->client['release'])) { + $this->client['release'] = Yii::$app->version; + } + + parent::init(); + } + +} diff --git a/common/config/config.php b/common/config/config.php index 2284c57..2819864 100644 --- a/common/config/config.php +++ b/common/config/config.php @@ -1,5 +1,6 @@ '1.1.3-dev', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'components' => [ 'cache' => [ @@ -35,11 +36,10 @@ return [ ], ], 'sentry' => [ - 'class' => mito\sentry\Component::class, + 'class' => common\components\Sentry\Component::class, 'enabled' => !empty(getenv('SENTRY_DSN')), 'dsn' => getenv('SENTRY_DSN'), 'environment' => YII_ENV_DEV ? 'development' : 'production', - 'jsNotifier' => false, 'client' => [ 'curl_method' => 'async', ],