Skip to content

Commit 2a11404

Browse files
authored
Merge pull request #12 from FamousWolf/typo3-11
Typo3 11 compatibility
2 parents 531c495 + f250e60 commit 2a11404

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2021-02-23 Rudy Gnodde <[email protected]>
2+
* Version 1.1.0
3+
* TYPO3 11 compatibility
4+
! No longer compatible with TYPO3 8.7
5+
16
2021-02-11 Rudy Gnodde
27
* Version 1.0.8
38
* Fix TYPO3 8.7 compatibility

Classes/Controller/RandomdataCommandController.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,7 @@ public function configure()
7474
*/
7575
public function execute(InputInterface $input, OutputInterface $output)
7676
{
77-
if (version_compare(TYPO3_version, '9.0.0', '>=')) {
78-
Bootstrap::initializeBackendAuthentication();
79-
} else {
80-
$bootstrap = Bootstrap::getInstance();
81-
$bootstrap->initializeBackendAuthentication();
82-
}
77+
Bootstrap::initializeBackendAuthentication();
8378
/** @var ObjectManager $objectManager */
8479
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
8580
/** @var RandomdataService $randomdataService */

Classes/Provider/FileProvider.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,14 @@ static public function generate(Generator $faker, array $configuration, Randomda
6868
}
6969

7070
if (!empty($configuration['source'])) {
71-
if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 9002000) {
72-
$sourceAbsolutePath = PATH_site . trim($configuration['source'], '/') . '/';
73-
} else {
74-
$sourceAbsolutePath = Environment::getPublicPath() . '/' . trim($configuration['source'], '/') . '/';
75-
}
71+
$sourceAbsolutePath = Environment::getPublicPath() . '/' . trim($configuration['source'], '/') . '/';
7672

7773
if (is_dir($sourceAbsolutePath)) {
7874
$count = $faker->numberBetween($configuration['minimum'], $configuration['maximum']);
7975
$files = self::getRandomFiles($sourceAbsolutePath, $count);
8076

8177
if (!empty($files)) {
82-
$resourceFactory = ResourceFactory::getInstance();
78+
$resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
8379
$references = [];
8480
foreach ($files as $file) {
8581
$fileObject = $resourceFactory->retrieveFileOrFolderObject($file);

Configuration/Commands.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
return [
33
'randomdata:generate' => [
44
'class' => \WIND\Randomdata\Controller\RandomdataCommandController::class,
5+
'schedulable' => false,
56
],
67
];

Configuration/Services.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
WIND\Randomdata\:
7+
resource: '../Classes/*'
8+
WIND\Randomdata\Controller\RandomdataCommandController:
9+
tags:
10+
- name: 'console.command'
11+
command: 'randomdata:generate'
12+
description: 'Generate random data'
13+
schedulable: false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "typo3-cms-extension",
55
"license": "GPL-3.0-or-later",
66
"require": {
7-
"typo3/cms-core": "^8.7 || ^9.5.17 || ^10.4.10",
7+
"typo3/cms-core": "^9.5.30 || ^10.4.20 || ^11.3.3",
88
"fzaninotto/faker": "^1.8"
99
},
1010
"replace": {

ext_emconf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
'state' => 'stable',
1010
'uploadfolder' => false,
1111
'clearCacheOnLoad' => false,
12-
'version' => '1.0.8',
12+
'version' => '1.1.0',
1313
'constraints' => [
1414
'depends' => [
15-
'typo3' => '8.7.13-10.4.99',
15+
'typo3' => '9.5.0-11.1.99',
1616
],
1717
'conflicts' => [
1818
],

0 commit comments

Comments
 (0)