Skip to content

Commit fa18ece

Browse files
committed
1.3.0
2 parents 1af093b + 8bc329f commit fa18ece

12 files changed

Lines changed: 96 additions & 124 deletions

File tree

Classes/Cache/RequestCache.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class RequestCache
1414

1515
public function __construct()
1616
{
17-
/** @phpstan-ignore-next-line */
1817
$this->repo = GeneralUtility::makeInstance(RequestCacheRecordRepository::class);
1918
}
2019

Classes/Controller/NominatimProxyController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ class NominatimProxyController extends ProxyController
2121
protected int $maxDbRecordsToCache;
2222
protected RequestCache $requestCache;
2323

24-
private RequestFactory $requestFactory;
2524
public function __construct(
26-
RequestFactory $requestFactory
25+
private RequestFactory $requestFactory
2726
) {
2827
parent::__construct();
2928
$this->requestFactory = $requestFactory;
30-
/** @phpstan-ignore-next-line */
29+
3130
$this->requestCache = GeneralUtility::makeInstance((RequestCache::class));
3231
/** @var ExtensionConfiguration $extConf */
3332
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class);

Classes/Controller/ProxyController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ abstract class ProxyController
1919

2020
public function __construct()
2121
{
22-
/** @phpstan-ignore-next-line */
2322
$this->streamFactory = GeneralUtility::makeInstance(StreamFactory::class);
2423
}
2524

Classes/Form/Element/BoundingBoxMapElement.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Codemacher\TileProxy\Form\Element;
66

77
use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
8-
use TYPO3\CMS\Core\Information\Typo3Version;
98

109
class BoundingBoxMapElement extends MapElement
1110
{
@@ -22,16 +21,7 @@ protected function createAttributes(array $parameterArray): array
2221
protected function enrichResultArray(array $resultArray): array
2322
{
2423
$resultArray = parent::enrichResultArray($resultArray);
25-
$typo3Version = new Typo3Version();
26-
if ($typo3Version->getMajorVersion() < 12) {
27-
$resultArray['requireJsModules'][] = JavaScriptModuleInstruction::forRequireJS(
28-
'TYPO3/CMS/TileProxy/BoundingBoxMapElement'
29-
);
30-
} else {
31-
/** @phpstan-ignore-next-line */
32-
$resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@codemacher/tile_proxy/BoundingBoxMapElement.js');
33-
}
34-
24+
$resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@codemacher/tile_proxy/BoundingBoxMapElement.js');
3525
$resultArray['stylesheetFiles'][] = 'EXT:tile_proxy/Resources/Public/Css/MapElement.css';
3626
return $resultArray;
3727
}

Classes/Form/Element/CenterZoomMapElement.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,7 @@ class CenterZoomMapElement extends MapElement
1414
protected function enrichResultArray(array $resultArray): array
1515
{
1616
$resultArray = parent::enrichResultArray($resultArray);
17-
$typo3Version = new Typo3Version();
18-
if ($typo3Version->getMajorVersion() < 12) {
19-
$resultArray['requireJsModules'][] = JavaScriptModuleInstruction::forRequireJS(
20-
'TYPO3/CMS/TileProxy/CenterZoomMapElement'
21-
);
22-
} else {
23-
/* @phpstan-ignore-next-line */
24-
$resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@codemacher/tile_proxy/CenterZoomMapElement.js');
25-
}
26-
17+
$resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@codemacher/tile_proxy/CenterZoomMapElement.js');
2718
$resultArray['stylesheetFiles'][] = 'EXT:tile_proxy/Resources/Public/Css/MapElement.css';
2819
return $resultArray;
2920
}

Classes/Middleware/TileProxyMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function fulfilsHostRestrictions(): bool
8181
$host = @$_SERVER['HTTP_HOST'];
8282
if(empty($referrer) || empty($host)) return false;
8383
$referrerPieces = parse_url($referrer);
84-
$referrerDomain = $this->getHostname($referrerPieces["host"]);
84+
$referrerDomain = $this->getHostname($referrerPieces["host"] ?? '');
8585
$hostDomain = $this->getHostname($host);
8686
return $referrerDomain == $hostDomain;
8787
}

Configuration/FlexForms/NominatimProxy.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
<type>array</type>
77
<el>
88
<settings.cacheTime>
9-
<TCEforms>
10-
<label>
11-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.requestCacheTime</label>
12-
<config>
13-
<type>input</type>
14-
<eval>trim,int</eval>
15-
<default>1209600</default>
16-
</config>
17-
</TCEforms>
9+
<label>
10+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.requestCacheTime</label>
11+
<config>
12+
<type>input</type>
13+
<eval>trim,int</eval>
14+
<default>1209600</default>
15+
</config>
1816
</settings.cacheTime>
1917
</el>
2018
</ROOT>

Configuration/FlexForms/TileProxy.xml

Lines changed: 52 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,81 +3,69 @@
33
<sheets>
44
<sDEF>
55
<ROOT>
6-
<TCEforms>
7-
<sheetTitle>Sheet Title</sheetTitle>
8-
</TCEforms>
6+
<sheetTitle>Sheet Title</sheetTitle>
97
<type>array</type>
108
<el>
119
<settings.cacheInfo>
12-
<TCEforms>
13-
<label>
14-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.cacheInfo</label>
15-
<config>
16-
<type>user</type>
17-
<renderType>cacheinfo</renderType>
18-
</config>
19-
</TCEforms>
20-
</settings.cacheInfo>
10+
<label>
11+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.cacheInfo</label>
12+
<config>
13+
<type>user</type>
14+
<renderType>cacheinfo</renderType>
15+
</config>
16+
</settings.cacheInfo>
2117
<settings.bbox>
22-
<TCEforms>
23-
<label>
24-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.bbox</label>
25-
<config>
26-
<type>user</type>
27-
<renderType>boundingboxmap</renderType>
28-
<eval>trim,required</eval>
29-
<default>11.86,51.41,12.07,51.55</default>
30-
</config>
31-
</TCEforms>
18+
<label>
19+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.bbox</label>
20+
<config>
21+
<type>user</type>
22+
<renderType>boundingboxmap</renderType>
23+
<eval>trim,required</eval>
24+
<default>11.86,51.41,12.07,51.55</default>
25+
</config>
3226
</settings.bbox>
3327
<settings.cachingUntilZoom>
34-
<TCEforms>
35-
<label>
36-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.cachingUntilZoom</label>
37-
<config>
38-
<type>input</type>
39-
<eval>trim,int</eval>
40-
<default>6</default>
41-
</config>
42-
</TCEforms>
28+
<label>
29+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.cachingUntilZoom</label>
30+
<config>
31+
<type>input</type>
32+
<eval>trim,int</eval>
33+
<default>6</default>
34+
</config>
4335
</settings.cachingUntilZoom>
4436
<settings.maxCachingZoom>
45-
<TCEforms>
46-
<label>
47-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.maxCachingZoom</label>
48-
<config>
49-
<type>input</type>
50-
<eval>trim,int</eval>
51-
<default>18</default>
52-
</config>
53-
</TCEforms>
54-
</settings.maxCachingZoom>
37+
<label>
38+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.maxCachingZoom</label>
39+
<config>
40+
<type>input</type>
41+
<eval>trim,int</eval>
42+
<default>18</default>
43+
</config>
44+
</settings.maxCachingZoom>
5545
<settings.passthrough>
56-
<TCEforms>
57-
<label>
58-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.passthrough</label>
59-
<config>
60-
<type>check</type>
61-
<items type="array">
62-
<numIndex index="0" type="array">
63-
<numIndex index="0">
64-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.yes</numIndex>
65-
<numIndex index="1"></numIndex>
66-
</numIndex>
67-
</items>
68-
</config>
69-
</TCEforms>
46+
<label>
47+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.passthrough</label>
48+
<config>
49+
<type>check</type>
50+
<default>1</default>
51+
<items type="array">
52+
<numIndex index="0">
53+
<label>
54+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.yes
55+
</label>
56+
<value>1</value>
57+
</numIndex>
58+
</items>
59+
</config>
7060
</settings.passthrough>
7161
<settings.cacheTime>
72-
<TCEforms>
73-
<label>
74-
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.cacheTime</label>
75-
<config>
76-
<type>input</type>
77-
<eval>trim,int</eval>
78-
<default>31536000</default>
79-
</config>
80-
</TCEforms>
62+
<label>
63+
LLL:EXT:tile_proxy/Resources/Private/Language/locallang.xlf:tx_tileproxy_flexform.settings.cacheTime</label>
64+
<config>
65+
<type>input</type>
66+
<eval>trim,int</eval>
67+
<default>31536000</default>
68+
</config>
8169
</settings.cacheTime>
8270
</el>
8371
</ROOT>

Configuration/TCA/Overrides/pages.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
$table,
1414
'doktype',
1515
[
16-
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang.xlf:doktype_tile_proxy',
17-
Constants::DOKTYPE_TILE_PROXY,
18-
'EXT:' . $extKey . '/Resources/Public/Icons/doktype-tileproxy.svg',
19-
'special'
20-
21-
],
16+
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang.xlf:doktype_tile_proxy',
17+
Constants::DOKTYPE_TILE_PROXY,
18+
'EXT:' . $extKey . '/Resources/Public/Icons/doktype-tileproxy.svg',
19+
'special'
20+
],
2221
'1',
2322
'after'
2423
);
@@ -27,11 +26,11 @@
2726
$table,
2827
'doktype',
2928
[
30-
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang.xlf:doktype_nominatim_proxy',
31-
Constants::DOKTYPE_NOMINATIM_PROXY,
32-
'EXT:' . $extKey . '/Resources/Public/Icons/doktype-nominatimproxy.svg',
33-
'special'
34-
],
29+
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang.xlf:doktype_nominatim_proxy',
30+
Constants::DOKTYPE_NOMINATIM_PROXY,
31+
'EXT:' . $extKey . '/Resources/Public/Icons/doktype-nominatimproxy.svg',
32+
'special'
33+
],
3534
'1',
3635
'after'
3736
);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
}
4141
},
4242
"require": {
43-
"typo3/cms-core": "^11.5|^12.4",
44-
"php": "^7.4.0 || ^8"
43+
"typo3/cms-core": "^12.4|^13.4",
44+
"php": "^8"
4545
}
4646
}

0 commit comments

Comments
 (0)