-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
101 lines (95 loc) · 3.87 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
call_user_func(
function() {
// Register fluid ViewHelper namespace
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['geo'] = ['Tollwerk\\TwGeo\\ViewHelpers'];
// Register or change services
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'tw_geo',
'geocoding',
\Tollwerk\TwGeo\Service\Geocoding\OpenStreetMapService::class,
[
'title' => 'OpenStreetMap',
'description' => 'Uses the OSM Nominatim web API',
'subtype' => '',
'available' => true,
'priority' => 50,
'quality' => 50,
'os' => '',
'exec' => '',
'className' => \Tollwerk\TwGeo\Service\Geocoding\OpenStreetMapService::class
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'tw_geo',
'geocoding',
\Tollwerk\TwGeo\Service\Geocoding\GoogleMapsService::class,
[
'title' => 'Google Maps',
'description' => 'Uses the Google Maps web API',
'subtype' => '',
'available' => true,
'priority' => 75,
'quality' => 75,
'os' => '',
'exec' => '',
'className' => \Tollwerk\TwGeo\Service\Geocoding\GoogleMapsService::class,
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'tw_geo',
'geolocation',
\Tollwerk\TwGeo\Service\Geolocation\PhpGeoIPService::class,
[
'title' => 'PHP GeoIP extension',
'description' => 'Uses PHP geoip_record_by_name() function',
'subtype' => '',
'available' => true,
'priority' => 50,
'quality' => 50,
'os' => '',
'exec' => '',
'className' => \Tollwerk\TwGeo\Service\Geolocation\PhpGeoIPService::class
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'tw_geo',
'geolocation',
\Tollwerk\TwGeo\Service\Geolocation\GeoiplookupService::class,
[
'title' => 'geoiplookup',
'description' => 'Uses geoiplookup shell command',
'subtype' => '',
'available' => true,
'priority' => 60,
'quality' => 50,
'os' => '',
'exec' => 'geoiplookup',
'className' => \Tollwerk\TwGeo\Service\Geolocation\GeoiplookupService::class
]
);
// Configure plugins
if(version_compare(TYPO3_version, '10.0.0', '<')) {
// @extensionScannerIgnoreLine
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Tollwerk.TwGeo',
'Debug',
['Debug' => 'geolocation, geocoding'],
['Debug' => 'geolocation, geocoding']
);
} else {
// @extensionScannerIgnoreLine
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Tollwerk.TwGeo',
'Debug',
[\Tollwerk\TwGeo\Controller\DebugController::class => 'geolocation, geocoding'],
[\Tollwerk\TwGeo\Controller\DebugController::class => 'geolocation, geocoding']
);
}
// Register hooks
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'][1556564992] = \Tollwerk\TwGeo\Hook\FormHook::class;
}
);