2016-12-08 02:21:01 +05:30
|
|
|
<?php
|
2019-12-29 20:25:21 +05:30
|
|
|
declare(strict_types=1);
|
2016-12-08 02:21:01 +05:30
|
|
|
|
2019-12-29 20:25:21 +05:30
|
|
|
namespace common\components;
|
2016-12-08 02:21:01 +05:30
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
use nohnaimer\sentry\Component;
|
2019-12-29 20:25:21 +05:30
|
|
|
use Yii;
|
2016-12-08 02:21:01 +05:30
|
|
|
|
2019-12-29 20:25:21 +05:30
|
|
|
class Sentry extends Component {
|
2016-12-08 02:21:01 +05:30
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
public bool $enabled = true;
|
|
|
|
|
|
|
|
public function init(): void {
|
2017-04-15 14:20:38 +05:30
|
|
|
if (!$this->enabled) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
if (is_array($this->clientOptions) && !isset($this->clientOptions['release'])) {
|
|
|
|
$this->clientOptions['release'] = Yii::$app->version;
|
2016-12-08 02:21:01 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
parent::init();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|