File tree Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Original file line number Diff line number Diff line change 5
5
use bazilio \yii \newrelic \handlers \BaseHandler ;
6
6
use bazilio \yii \newrelic \handlers \ConsoleHandler ;
7
7
use bazilio \yii \newrelic \handlers \WebHandler ;
8
- use NewRelic \NewRelic as Agent ;
8
+ use SobanVuex \NewRelic \ Agent ;
9
9
use yii \base \BootstrapInterface ;
10
10
use yii \base \Component ;
11
11
@@ -20,7 +20,7 @@ class Newrelic extends Component implements BootstrapInterface
20
20
*/
21
21
public $ enabled = true ;
22
22
/**
23
- * @var \NewRelic\NewRelic
23
+ * @var Agent
24
24
*/
25
25
public $ agent ;
26
26
@@ -71,7 +71,7 @@ public function init()
71
71
parent ::init ();
72
72
73
73
if ($ this ->enabled ) {
74
- if (Agent:: isLoaded ( )) {
74
+ if (extension_loaded ( ' newrelic ' )) {
75
75
$ this ->name = $ this ->name ? $ this ->name : \Yii::$ app ->name ;
76
76
$ this ->agent = new Agent ();
77
77
$ this ->agent ->setAppname ($ this ->name , $ this ->licence );
Original file line number Diff line number Diff line change 11
11
}
12
12
],
13
13
"require" : {
14
- "sobanvuex/php-newrelic" : " 1.* " ,
14
+ "sobanvuex/php-newrelic" : " ^2.0 " ,
15
15
"php" : " >=5.4.0" ,
16
16
"yiisoft/yii2" : " *"
17
17
},
Original file line number Diff line number Diff line change @@ -8,13 +8,6 @@ class BaseHandler extends Handler
8
8
{
9
9
public function bootstrap ($ app )
10
10
{
11
- $ app ->on (
12
- Application::EVENT_BEFORE_REQUEST ,
13
- function () use ($ app ) {
14
- $ this ->getAgent ()->startTransaction ($ this ->newrelic ->name );
15
- }
16
- );
17
-
18
11
$ app ->on (
19
12
Application::EVENT_BEFORE_ACTION ,
20
13
function () use ($ app ) {
@@ -25,12 +18,5 @@ function () use ($app) {
25
18
. $ app ->requestedAction ->id );
26
19
}
27
20
);
28
-
29
- $ app ->on (
30
- Application::EVENT_AFTER_REQUEST ,
31
- function () use ($ app ) {
32
- $ this ->getAgent ()->endOfTransaction ();
33
- }
34
- );
35
21
}
36
- }
22
+ }
You can’t perform that action at this time.
0 commit comments