This repository has been archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
ext_localconf.php
49 lines (39 loc) · 2.1 KB
/
ext_localconf.php
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
<?php
$extensionPath = t3lib_extMgm::extPath('newrelic');
require_once $extensionPath.'Classes/Service.php';
require_once $extensionPath.'Hooks/class.tx_newrelic_hooks.php';
/** @var \AOE\Newrelic\Service $service */
$service = t3lib_div::makeInstance('\AOE\Newrelic\Service');
$service->setConfiguredAppName();
$service->setTransactionNameDefault('Base');
$service->addCommonRequestParameters();
if (isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] == 'CLI Mode') {
$service->addTransactionNamePostfix('DirectRequest');
}
if (isset($_SERVER['HTTP_X_T3CRAWLER'])) {
$service->addTransactionNamePostfix('Crawler');
}
if (defined('TYPO3_cliMode') && TYPO3_cliMode) {
$service->setTransactionName('CliMode');
}
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$service->addTransactionNamePostfix('FORMSUBMIT');
}
/**** BACKEND ***/
if (defined('TYPO3_MODE') && TYPO3_MODE == 'BE') {
/** @var \AOE\Newrelic\Service $service */
$service = t3lib_div::makeInstance('\AOE\Newrelic\Service');
$service->setConfiguredAppName();
$service->setTransactionName('Backend');
}
/**** FRONTEND ***/
if (defined('TYPO3_MODE') && TYPO3_MODE == 'FE') {
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest']['newrelic'] = 'EXT:newrelic/Hooks/class.tx_newrelic_hooks.php:tx_newrelic_hooks->frontendPreprocessRequest';
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['newrelic'] = 'EXT:newrelic/Hooks/class.tx_newrelic_hooks.php:tx_newrelic_hooks->frontendEndOfFrontend';
if (t3lib_extMgm::isLoaded('extracache')) {
$configurationManager = t3lib_div::makeInstance ( 'Tx_Extracache_Configuration_ConfigurationManager' );
$configurationManager->addContentProcessorDefinition ( '\AOE\Newrelic\ExtraCacheContentProcessor', $extensionPath . 'Classes/ExtraCacheContentProcessor.php' );#
$dispatcher = t3lib_div::makeInstance ( 'Tx_Extracache_System_Event_Dispatcher' );
$dispatcher->addLazyLoadingHandler ( 'onStaticCacheContext', 'tx_newrelic_hooks', 'handleEventOnStaticCacheContext' );
}
}