Skip to content

Commit 2b9c955

Browse files
committed
[TASK] Support 11.5
1 parent 44938d3 commit 2b9c955

File tree

6 files changed

+44
-28
lines changed

6 files changed

+44
-28
lines changed

Classes/Command/ImportRedirectCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(string $name = null)
4343
*/
4444
public function configure()
4545
{
46-
$this->setDescription('Redirect command')
46+
$this->setDescription('Import redirect')
4747
->addArgument('file', InputArgument::REQUIRED, 'File to be imported')
4848
->addOption(
4949
'dry-run',
@@ -81,8 +81,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
8181

8282
$csvReader = GeneralUtility::makeInstance(CsvReader::class);
8383
$csvReader->heading = true;
84-
$csvReader->delimiter = ',';
85-
$csvReader->enclosure = '"';
84+
$csvReader->delimiter = ';';
85+
$csvReader->enclosure = '';
8686
$csvReader->parse($filePath);
8787

8888
try {
@@ -140,7 +140,7 @@ protected function importItems(array $items, bool $dryRun): array
140140
}
141141

142142
$configuration = $this->getConfigurationFromItem($item);
143-
if ($item['external'] === '1' || $this->isExternalDomain($item['target'])) {
143+
if ($item['external'] ?? '' === '1' || $this->isExternalDomain($item['target'] ?? '')) {
144144
$targetUrl = $item['target'];
145145
} else {
146146
$result = $this->urlMatcher->getUrlData($item['target']);

Configuration/Commands.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

Configuration/Services.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
GeorgRinger\RedirectGenerator\Command\AddRedirectCommand:
8+
tags:
9+
- name: 'console.command'
10+
command: 'redirect:add'
11+
description: 'Add redirect to the redirects table'
12+
schedulable: false
13+
14+
GeorgRinger\RedirectGenerator\Command\ImportRedirectCommand:
15+
tags:
16+
- name: 'console.command'
17+
command: 'redirect:import'
18+
description: 'Import redirect'
19+
schedulable: false
20+
21+
GeorgRinger\RedirectGenerator\Command\ExportRedirectCommand:
22+
tags:
23+
- name: 'console.command'
24+
command: 'redirect:export'
25+
description: 'Export redirects as csv'
26+
schedulable: false

Readme.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ Use the following CLI command:
4141
./bin/typo3 redirect:import <path-to-file.csv>
4242
```
4343

44+
````csv
45+
"source","target","status_code"
46+
"/fo/bar","https://demo.ddev.site/examples/extensions/news","301"
47+
"/fo/bar2","https://demo.ddev.site/examples/extensions/news","307"
48+
"/fo/bar3","https://v/exakqwkqkwmples/extensions/news"
49+
50+
````
51+
4452
A sample CSV file can be found at `EXT:redirect_generator/Resources/Private/Examples/ImportBasic.csv`
4553

4654
The following options are available:
@@ -57,4 +65,4 @@ Use the following CLI command:
5765

5866
```bash
5967
./bin/typo3 redirect:export export.csv --transform-target-url
60-
```
68+
```

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"GPL-2.0-or-later"
2323
],
2424
"require": {
25-
"typo3/cms-core": "^9.5|| ^10.1",
26-
"typo3/cms-redirects": "^9.5|| ^10.1"
25+
"typo3/cms-core": "^10.1 || ^11.5",
26+
"typo3/cms-redirects": "^10.1 || ^11.5"
2727
},
2828
"autoload": {
2929
"psr-4": {

ext_emconf.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
'author_email' => 'mail@ringer.it',
99
'state' => 'beta',
1010
'clearCacheOnLoad' => true,
11-
'version' => '0.2.0',
11+
'version' => '0.3.0',
1212
'constraints' =>
1313
[
1414
'depends' => [
15-
'typo3' => '9.5.9-10.9.90',
16-
'redirects' => '9.5.9-10.9.90'
15+
'typo3' => '10.4.90-11.5.99',
16+
'redirects' => '10.4.90-11.5.99',
1717
],
1818
'conflicts' => [],
1919
'suggests' => [],

0 commit comments

Comments
 (0)