This repository was archived by the owner on Feb 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBootstrap.php
More file actions
executable file
·76 lines (61 loc) · 1.44 KB
/
Bootstrap.php
File metadata and controls
executable file
·76 lines (61 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* Das ist das Bootstrap-File des Plugins
*
* Class Shopware_Plugins_Frontend_NewRelicIntegration_Bootstrap
*/
class Shopware_Plugins_Frontend_NewRelicIntegration_Bootstrap extends Shopware_Components_Plugin_Bootstrap
{
/**
* returns the label
*
* @return string
*/
public function getLabel()
{
return 'NewRelicIntegration';
}
/**
* returns the version
*
* @return string
*/
public function getVersion()
{
return '0.1.0';
}
/**
* includes the info of this plugin
*
* @return array|mixed
*/
public function getInfo()
{
return include(dirname(__FILE__) . '/Meta.php');
}
/**
* the install function of this plugin
*
* @return bool
*/
public function install()
{
$this->subscribeEvent(
'Enlight_Controller_Action_PostDispatch',
'onPostDispatch',
100
);
return true;
}
public function onPostDispatch(Enlight_Controller_ActionEventArgs $args)
{
$request = $args->getSubject()->Request();
$response = $args->getSubject()->Response();
if (!$request->isDispatched() || $response->isException()) {
return;
}
if (extension_loaded('newrelic')) {
newrelic_name_transaction($request->getControllerName() . '/' . $request->getActionName());
}
}
}