17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
68 if (!isset($configuration[
'vendorName']) || $configuration[
'vendorName'] ===
'') {
69 throw new \RuntimeException(
'Invalid configuration: "vendorName" is not set', 1526629315);
71 if (!isset($configuration[
'extensionName']) || $configuration[
'extensionName'] ===
'') {
72 throw new \RuntimeException(
'Invalid configuration: "extensionName" is not set', 1290623020);
74 if (!isset($configuration[
'pluginName']) || $configuration[
'pluginName'] ===
'') {
75 throw new \RuntimeException(
'Invalid configuration: "pluginName" is not set', 1290623027);
91 $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\
TYPO3\CMS\
Extbase\Object\ObjectManager::class);
103 $this->configurationManager = $this->objectManager->get(\
TYPO3\CMS\
Extbase\Configuration\ConfigurationManagerInterface::class);
105 $contentObject = $this->cObj ?? \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\
TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
106 $this->configurationManager->setContentObject($contentObject);
107 $this->configurationManager->setConfiguration($configuration);
120 if (!$isInternalCall) {
121 trigger_error(self::class .
'::configureObjectManager() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
123 $frameworkSetup = $this->configurationManager->getConfiguration(\
TYPO3\CMS\
Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
124 if (!isset($frameworkSetup[
'objects']) || !is_array($frameworkSetup[
'objects'])) {
127 trigger_error(
'Overriding object implementations via TypoScript settings config.tx_extbase.objects and plugin.tx_%plugin%.objects will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
128 $objectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\
TYPO3\CMS\
Extbase\Object\Container\Container::class);
129 foreach ($frameworkSetup[
'objects'] as $classNameWithDot => $classConfiguration) {
130 if (isset($classConfiguration[
'className'])) {
131 $originalClassName = rtrim($classNameWithDot,
'.');
132 $objectContainer->registerImplementation($originalClassName, $classConfiguration[
'className']);
145 $this->persistenceManager = $this->objectManager->get(\
TYPO3\CMS\
Extbase\Persistence\Generic\PersistenceManager::class);
156 public function run($content, $configuration)
169 $requestHandlerResolver = $this->objectManager->get(\
TYPO3\CMS\
Extbase\Mvc\RequestHandlerResolver::class);
170 $requestHandler = $requestHandlerResolver->resolveRequestHandler();
172 $response = $requestHandler->handleRequest();
176 if ($response ===
null) {
179 $content = $response->shutdown();
181 $this->objectManager->get(\
TYPO3\CMS\
Extbase\Service\CacheService::class)->clearCachesOfRegisteredPageIds();
182 if ($response instanceof CliResponse && $response->getExitCode()) {
183 throw new \TYPO3\CMS\Extbase\Mvc\Exception\CommandException(
'The request has been terminated as the response defined an exit code.', $response->getExitCode());
201 $route = $request->getAttribute(
'route');
202 $moduleConfiguration = $route->getOption(
'moduleConfiguration');
204 'extensionName' => $moduleConfiguration[
'extensionName'],
205 'pluginName' => $route->getOption(
'moduleName')
207 if (isset($moduleConfiguration[
'vendorName'])) {
208 $configuration[
'vendorName'] = $moduleConfiguration[
'vendorName'];
214 $requestHandlerResolver = $this->objectManager->get(\
TYPO3\CMS\
Extbase\Mvc\RequestHandlerResolver::class);
215 $requestHandler = $requestHandlerResolver->resolveRequestHandler();
217 $extbaseResponse = $requestHandler->handleRequest();
222 $this->objectManager->get(\
TYPO3\CMS\
Extbase\Service\CacheService::class)->clearCachesOfRegisteredPageIds();
234 $response = new \TYPO3\CMS\Core\Http\Response(
236 $extbaseResponse->getStatusCode(),
237 $extbaseResponse->getUnpreparedHeaders()
239 $content = $extbaseResponse->getContent();
240 if ($content !==
null) {
241 $response->getBody()->write($content);
251 $this->persistenceManager->persistAll();