We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d90afc9 commit 0b8fc57Copy full SHA for 0b8fc57
Classes/Command/FakeRequestTrait.php
@@ -0,0 +1,23 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+namespace In2code\Powermail\Command;
5
6
+use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
7
+use TYPO3\CMS\Core\Http\ServerRequest;
8
9
+/**
10
+ * It is not possible to create an instance of an extbase repository in a symfony command anymore in TYPO3 12 or newer
11
+ * So we have to fake a request, to get this running again.
12
+ */
13
+trait FakeRequestTrait
14
+{
15
+ protected function fakeRequest()
16
+ {
17
+ if (!isset($GLOBALS['TYPO3_REQUEST'])) {
18
+ $request = (new ServerRequest())
19
+ ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);
20
+ $GLOBALS['TYPO3_REQUEST'] = $request;
21
+ }
22
23
+}
0 commit comments