If you need help solving this exception, you can have a look at the TYPO3 Documentation. There you can find solutions provided by the TYPO3 community. Once you have found a solution to the problem, help others by contributing to the documentation page.
Find a solution for this exception in the TYPO3 Documentation.
// Fetches data in case $fileData is empty if (empty($fileData)) { $fileData = $this->getFileIndexRepository()->findOneByUid($uid); if ($fileData === false) { throw new FileDoesNotExistException('No file found for given UID: ' . $uid, 1317178604); } } $this->fileInstances[$uid] = $this->createFileObject($fileData); }
{ if ($factory === null) { $factory = GeneralUtility::makeInstance(ResourceFactory::class); } return $factory->getFileObject($uidLocal); } /******************************* * VARIOUS FILE PROPERTY GETTERS
$this->propertiesOfFileReference = $fileReferenceData; if (!$fileReferenceData['uid_local']) { throw new \InvalidArgumentException('Incorrect reference to original file given for FileReference.', 1300098528); } $this->originalFile = $this->getFileObject((int)$fileReferenceData['uid_local'], $factory); } /** * @param int $uidLocal
return self::$container->get($className); } // Create new instance and call constructor with parameters $instance = new $finalClassName(...$constructorArguments); // Register new singleton instance, but only if it is not a known PSR-11 container service if ($instance instanceof SingletonInterface && !(self::$container !== null && self::$container->has($className))) { self::$singletonInstances[$finalClassName] = $instance; }
* @return FileReference */ public function createFileReferenceObject(array $fileReferenceData) { $fileReferenceObject = GeneralUtility::makeInstance(FileReference::class, $fileReferenceData); return $fileReferenceObject; } /**
1317178794 ); } } $this->fileReferenceInstances[$uid] = $this->createFileReferenceObject($fileReferenceData); } return $this->fileReferenceInstances[$uid]; }
public function getOriginalResource() { if ($this->originalResource === null) { $uid = $this->_localizedUid; $this->originalResource = GeneralUtility::makeInstance(ResourceFactory::class)->getFileReferenceObject($uid); } return $this->originalResource; }
$items = []; if ($this->getFalMedia()) { foreach ($this->getFalMedia() as $mediaItem) { /** @var FileReference $mediaItem */ $configuration = (int)$mediaItem->getOriginalResource()->getProperty('showinpreview'); if (in_array($configuration, $list, true)) { $items[] = $mediaItem; } }
*/ public function getMediaPreviews(): array { $configuration = [FileReference::VIEW_LIST_AND_DETAIL, FileReference::VIEW_LIST_ONLY]; return $this->getMediaItemsByConfiguration($configuration); } /** * Get all media elements which are allowed for detail views
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference|null */ public function getFirstPreview(): ?\TYPO3\CMS\Extbase\Domain\Model\FileReference { foreach ($this->getMediaPreviews() as $mediaElement) { return $mediaElement; } return null; }
return $subject[$propertyName]; } if (is_object($subject)) { if ($accessor === self::ACCESSOR_GETTER) { return call_user_func_array([$subject, 'get' . ucfirst($propertyName)], []); } if ($accessor === self::ACCESSOR_ASSERTER) { return $this->extractThroughAsserter($subject, $propertyName); }
{ if (!$accessor || !$this->canExtractWithAccessor($subject, $propertyName, $accessor)) { $accessor = $this->detectAccessor($subject, $propertyName); } return $this->extractWithAccessor($subject, $propertyName, $accessor); } /** * Returns TRUE if the data type of $subject is potentially compatible
{ $subject = $this->variables; foreach (explode('.', $this->resolveSubVariableReferences($path)) as $index => $pathSegment) { $accessor = isset($accessors[$index]) ? $accessors[$index] : null; $subject = $this->extractSingleValue($subject, $pathSegment, $accessor); if ($subject === null) { break; } }
// Rendering Boolean node // Rendering Array $array35 = array(); $array36 = array ( );$array35['0'] = $renderingContext->getVariableProvider()->getByPath('newsItem.firstPreview', $array36); $expression37 = function($context) {return TYPO3Fluid\Fluid\Core\Parser\BooleanParser::convertNodeToBoolean($context["node0"]);}; $arguments33['condition'] = TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean( $expression37(
$this->startRendering(self::RENDERING_PARTIAL, $parsedPartial, $renderingContext); if ($sectionName !== null) { $output = $this->renderSection($sectionName, $variables, $ignoreUnknown); } else { $output = $parsedPartial->render($renderingContext); } $this->stopRendering(); return $output; }
$renderingContext = clone $renderingContext; $renderingContext->getVariableProvider()->setSource($variables); $content = (new $delegate())->render($renderingContext); } elseif ($partial !== null) { $content = $view->renderPartial($partial, $section, $variables, $optional); } elseif ($section !== null) { $content = $view->renderSection($section, $variables, $optional); } elseif (!$optional) { throw new \InvalidArgumentException('ViewHelper f:render called without either argument section, partial, renderable or delegate and optional flag is false');
$array89 = array ( );$array87['settings'] = $renderingContext->getVariableProvider()->getByPath('settings', $array89); $arguments85['arguments'] = $array87; $output84 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments85, $renderChildrenClosure86, $renderingContext); $output84 .= ' '; return $output84;
if (isset($arguments['then'])) { return $arguments['then']; } if (isset($arguments['__thenClosure'])) { return $arguments['__thenClosure'](); } } elseif (!empty($arguments['__elseClosures'])) { $elseIfClosures = isset($arguments['__elseifClosures']) ? $arguments['__elseifClosures'] : []; return static::evaluateElseClosures($arguments['__elseClosures'], $elseIfClosures, $renderingContext);
$renderingContext ); $arguments79['__thenClosure'] = $renderChildrenClosure80; $output75 .= TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper::renderStatic($arguments79, $renderChildrenClosure80, $renderingContext); $output75 .= ' '; // Rendering ViewHelper TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper
public function renderChildren() { if ($this->renderChildrenClosure !== null) { $closure = $this->renderChildrenClosure; return $closure(); } return $this->viewHelperNode->evaluateChildNodes($this->renderingContext); }
* Render children but do nothing else */ public function render(): void { $this->renderChildren(); } }
*/ protected function callRenderMethod() { if (method_exists($this, 'render')) { return call_user_func([$this, 'render']); } if ((new \ReflectionMethod($this, 'renderStatic'))->getDeclaringClass()->getName() !== AbstractViewHelper::class) { // Method is safe to call - will not recurse through ViewHelperInvoker via the default // implementation of renderStatic() on this class.
{ $this->validateArguments(); $this->initialize(); return $this->callRenderMethod(); } /** * Call the render() method and handle errors.
} $viewHelper->setRenderingContext($renderingContext); $viewHelper->setArguments($evaluatedArguments); $viewHelper->handleAdditionalArguments($undeclaredArguments); return $viewHelper->initializeArgumentsAndRender(); } catch (Exception $error) { return $renderingContext->getErrorHandler()->handleViewHelperError($error); } }
*/ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $viewHelperClassName = get_called_class(); return $renderingContext->getViewHelperInvoker()->invoke($viewHelperClassName, $arguments, $renderingContext, $renderChildrenClosure); } /** * Save the associated ViewHelper node in a static public class variable.
return $output75; }; $arguments73 = array(); $output72 .= GeorgRinger\News\ViewHelpers\Format\NothingViewHelper::renderStatic($arguments73, $renderChildrenClosure74, $renderingContext); $output72 .= ' '; // Rendering ViewHelper TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper
if (isset($arguments['then'])) { return $arguments['then']; } if (isset($arguments['__thenClosure'])) { return $arguments['__thenClosure'](); } } elseif (!empty($arguments['__elseClosures'])) { $elseIfClosures = isset($arguments['__elseifClosures']) ? $arguments['__elseifClosures'] : []; return static::evaluateElseClosures($arguments['__elseClosures'], $elseIfClosures, $renderingContext);
'; }; $output0 .= TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper::renderStatic($arguments70, $renderChildrenClosure71, $renderingContext); $output0 .= ' </div> <div class="news-detail-img">
new InvalidSectionException('Section "' . $sectionName . '" does not exist.') ); } $this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext); $output = $parsedTemplate->$methodNameOfSection($renderingContext); $this->stopRendering(); } else { $sections = $parsedTemplate->getVariableContainer()->get('1457379500_sections'); if (!isset($sections[$sectionName])) {
$content = (new $delegate())->render($renderingContext); } elseif ($partial !== null) { $content = $view->renderPartial($partial, $section, $variables, $optional); } elseif ($section !== null) { $content = $view->renderSection($section, $variables, $optional); } elseif (!$optional) { throw new \InvalidArgumentException('ViewHelper f:render called without either argument section, partial, renderable or delegate and optional flag is false'); } // Replace empty content with default value. If default is
$arguments10['contentAs'] = NULL; $arguments10['debug'] = true; $arguments10['section'] = 'content'; $output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments10, $renderChildrenClosure11, $renderingContext); $output0 .= ' </div> </div>
} catch (PassthroughSourceException $error) { return $error->getSource(); } $this->startRendering(self::RENDERING_LAYOUT, $parsedTemplate, $this->baseRenderingContext); $output = $parsedLayout->render($this->baseRenderingContext); $this->stopRendering(); } return $output;
protected function htmlResponse(string $html = null): ResponseInterface { return $this->responseFactory->createResponse() ->withHeader('Content-Type', 'text/html; charset=utf-8') ->withBody($this->streamFactory->createStream((string)($html ?? $this->view->render()))); } /** * Returns a response object with either the given json string or the current rendered
if ($errorResponse) { return $errorResponse; } } return $this->htmlResponse(); } /** * Checks if the news pid could be found in the startingpoint settings of the detail plugin and
} $validationResult = $this->arguments->validate(); if (!$validationResult->hasErrors()) { $this->eventDispatcher->dispatch(new BeforeActionCallEvent(static::class, $this->actionMethodName, $preparedArguments)); $actionResult = $this->{$this->actionMethodName}(...$preparedArguments); } else { $actionResult = $this->{$this->errorMethodName}(); }
$this->view = $this->resolveView(); if ($this->view !== null && method_exists($this, 'initializeView')) { $this->initializeView($this->view); } $response = $this->callActionMethod($request); $this->renderAssetsForRequest($request); return $response; }
throw new InfiniteLoopException('Could not ultimately dispatch the request after ' . $dispatchLoopCount . ' iterations. Most probably, a @' . IgnoreValidation::class . ' annotation is missing on re-displaying a form with validation errors.', 1217839467); } $controller = $this->resolveController($request); try { $response = $controller->processRequest($request); if ($response instanceof ForwardResponse) { // The controller action returned an extbase internal Forward response: // Another action should be dispatched. $request = static::buildRequestFromCurrentRequestAndForwardResponse($request, $response);
* @throws InfiniteLoopException */ public function handleRequest(RequestInterface $request) { return $this->dispatcher->dispatch($request); } /** * This request handler can handle any web request.
} // Dispatch the extbase request $requestHandler = $this->requestHandlerResolver->resolveRequestHandler($extbaseRequest); $response = $requestHandler->handleRequest($extbaseRequest); if ($response->getStatusCode() >= 300) { // Avoid caching the plugin when we issue a redirect or error response // This means that even when an action is configured as cachable // we avoid the plugin to be cached, but keep the page cache untouched
public function run(string $content, array $configuration, ?ServerRequestInterface $request = null): string { $request = $request ?? $GLOBALS['TYPO3_REQUEST']; $this->initialize($configuration); return $this->handleFrontendRequest($request); } protected function handleFrontendRequest(ServerRequestInterface $request): string {
// Extensions should either drop the property altogether if they don't need current instance // of ContentObjectRenderer, or set the property to protected and use the setter above. $classObj->cObj = $this; } $content = $callable($content, $conf, $this->getRequest()); } else { $this->getTimeTracker()->setTSlogMessage('Method "' . $parts[1] . '" did not exist in class "' . $parts[0] . '"', LogLevel::ERROR); } } else {
if ($this->cObj->getUserObjectType() === false) { // Come here only if we are not called from $TSFE->processNonCacheableContentPartsAndSubstituteContentMarkers()! $this->cObj->setUserObjectType(ContentObjectRenderer::OBJECTTYPE_USER); } $tempContent = $this->cObj->callUserFunction($conf['userFunc'], $conf, ''); if ($this->cObj->doConvertToUserIntObject) { $this->cObj->doConvertToUserIntObject = false; $content = $this->cObj->cObjGetSingle('USER_INT', $conf); } else {
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) { $content .= $this->render($contentObject, $conf); } } if ($timeTracker->LR) { $timeTracker->pull($content);
if ($timeTracker->LR) { $timeTracker->push('/f:cObject/', '<' . $typoscriptObjectPath); } $timeTracker->incStackPointer(); $content = $contentObjectRenderer->cObjGetSingle($setup[$lastSegment], $setup[$lastSegment . '.'] ?? [], $typoscriptObjectPath); $timeTracker->decStackPointer(); if ($timeTracker->LR) { $timeTracker->pull($content); }
'No Content Object definition found at TypoScript object path "' . $typoscriptObjectPath . '"', 1540246570 ); } $content = self::renderContentObject($contentObjectRenderer, $setup, $typoscriptObjectPath, $lastSegment); if (!isset($GLOBALS['TSFE']) || !($GLOBALS['TSFE'] instanceof TypoScriptFrontendController)) { static::resetFrontendEnvironment(); } return $content;
$arguments8['typoscriptObjectPath'] = $output10; $array12 = array ( );$arguments8['data'] = $renderingContext->getVariableProvider()->getByPath('data', $array12); $arguments8['table'] = 'tt_content'; $renderChildrenClosure9 = ($arguments8['data'] !== null) ? function() use ($arguments8) { return $arguments8['data']; } : $renderChildrenClosure9;return TYPO3\CMS\Fluid\ViewHelpers\CObjectViewHelper::renderStatic($arguments8, $renderChildrenClosure9, $renderingContext); }; $output0 .= TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper::renderStatic($arguments3, $renderChildrenClosure4, $renderingContext);
private static function evaluateElseClosures(array $closures, array $conditionClosures, RenderingContextInterface $renderingContext) { foreach ($closures as $elseNodeIndex => $elseNodeClosure) { if (!isset($conditionClosures[$elseNodeIndex])) { return $elseNodeClosure(); } if ($conditionClosures[$elseNodeIndex]()) { return $elseNodeClosure(); }
return $arguments['__thenClosure'](); } } elseif (!empty($arguments['__elseClosures'])) { $elseIfClosures = isset($arguments['__elseifClosures']) ? $arguments['__elseifClosures'] : []; return static::evaluateElseClosures($arguments['__elseClosures'], $elseIfClosures, $renderingContext); } elseif (array_key_exists('else', $arguments)) { return $arguments['else']; } return '';
$arguments8['table'] = 'tt_content'; $renderChildrenClosure9 = ($arguments8['data'] !== null) ? function() use ($arguments8) { return $arguments8['data']; } : $renderChildrenClosure9;return TYPO3\CMS\Fluid\ViewHelpers\CObjectViewHelper::renderStatic($arguments8, $renderChildrenClosure9, $renderingContext); }; $output0 .= TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper::renderStatic($arguments3, $renderChildrenClosure4, $renderingContext); $output0 .= ' ';
new InvalidSectionException('Section "' . $sectionName . '" does not exist.') ); } $this->startRendering($renderingTypeOnNextLevel, $parsedTemplate, $renderingContext); $output = $parsedTemplate->$methodNameOfSection($renderingContext); $this->stopRendering(); } else { $sections = $parsedTemplate->getVariableContainer()->get('1457379500_sections'); if (!isset($sections[$sectionName])) {
$content = (new $delegate())->render($renderingContext); } elseif ($partial !== null) { $content = $view->renderPartial($partial, $section, $variables, $optional); } elseif ($section !== null) { $content = $view->renderSection($section, $variables, $optional); } elseif (!$optional) { throw new \InvalidArgumentException('ViewHelper f:render called without either argument section, partial, renderable or delegate and optional flag is false'); } // Replace empty content with default value. If default is
), $renderingContext ); $output3 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments45, $renderChildrenClosure46, $renderingContext); $output3 .= ' '; // Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
if (isset($arguments['then'])) { return $arguments['then']; } if (isset($arguments['__thenClosure'])) { return $arguments['__thenClosure'](); } } elseif (!empty($arguments['__elseClosures'])) { $elseIfClosures = isset($arguments['__elseifClosures']) ? $arguments['__elseifClosures'] : []; return static::evaluateElseClosures($arguments['__elseClosures'], $elseIfClosures, $renderingContext);
'; return $output65; }; $output0 .= TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper::renderStatic($arguments1, $renderChildrenClosure2, $renderingContext); $output0 .= ' ';
} catch (PassthroughSourceException $error) { return $error->getSource(); } $this->startRendering(self::RENDERING_LAYOUT, $parsedTemplate, $this->baseRenderingContext); $output = $parsedLayout->render($this->baseRenderingContext); $this->stopRendering(); } return $output;
* @return string */ protected function renderFluidView() { return $this->view->render(); } /** * Apply standard wrap to content
$this->view->assignMultiple($variables); $this->renderFluidTemplateAssetsIntoPageRenderer(); $content = $this->renderFluidView(); $content = $this->applyStandardWrapToRenderedContent($content, $conf); $this->view = $parentView; return $content;
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) { $content .= $this->render($contentObject, $conf); } } if ($timeTracker->LR) { $timeTracker->pull($content);
[$name, $conf] = $cF->getVal($key, $this->getTypoScriptFrontendController()->tmpl->setup); $conf = array_replace_recursive($conf, $confOverride); // Getting the cObject $timeTracker->incStackPointer(); $content .= $this->cObjGetSingle($name, $conf, $key); $timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) {
// If no "default" property is available, then an empty string is returned if ($key === 'default' && !isset($conf['default'])) { $theValue = ''; } else { $theValue = $this->cObj->cObjGetSingle($conf[$key], $conf[$key . '.'] ?? [], $key); } if (isset($conf['stdWrap.'])) { $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']); }
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) { $content .= $this->render($contentObject, $conf); } } if ($timeTracker->LR) { $timeTracker->pull($content);
[$name, $conf] = $cF->getVal($key, $this->getTypoScriptFrontendController()->tmpl->setup); $conf = array_replace_recursive($conf, $confOverride); // Getting the cObject $timeTracker->incStackPointer(); $content .= $this->cObjGetSingle($name, $conf, $key); $timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) {
$cObj->parentRecordNumber = $this->cObj->currentRecordNumber; $frontendController->currentRecord = $registerField; $this->cObj->lastChanged($row['tstamp'] ?? 0); $cObj->start($row, $conf['table'], $this->request); $tmpValue = $cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey); $cobjValue .= $tmpValue; } } }
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) { $content .= $this->render($contentObject, $conf); } } if ($timeTracker->LR) { $timeTracker->pull($content);
continue; } if (!in_array($variableName, $reservedVariables)) { $cObjConf = $variablesToProcess[$variableName . '.'] ?? []; $variables[$variableName] = $this->cObj->cObjGetSingle($cObjType, $cObjConf, 'variables.' . $variableName); } else { throw new \InvalidArgumentException( 'Cannot use reserved name "' . $variableName . '" as variable name in FLUIDTEMPLATE.', 1288095720
*/ protected function getContentObjectVariables(array $conf = []): array { // Call Parent Function to maintain core functions $variables = parent::getContentObjectVariables($conf); // Make some enhancements to data of pages if ($this->cObj->getCurrentTable() === 'pages') { $data = $variables['data'];
$this->setLayoutRootPath($conf); $this->setPartialRootPath($conf); $this->setExtbaseVariables($conf); $this->assignSettings($conf); $variables = $this->getContentObjectVariables($conf); $variables = $this->contentDataProcessor->process($this->cObj, $conf, $variables); $this->view->assignMultiple($variables);
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$timeTracker->decStackPointer(); } else { $contentObject = $this->getContentObject($name); if ($contentObject) { $content .= $this->render($contentObject, $conf); } } if ($timeTracker->LR) { $timeTracker->pull($content);
foreach ($sKeyArray as $theKey) { $theValue = $setup[$theKey]; if ((int)$theKey && !str_contains($theKey, '.')) { $conf = $setup[$theKey . '.'] ?? []; $contentObjects[] = $this->cObjGetSingle($theValue, $conf, $addKey . $theKey); } } return $contentObjects; }
{ if (!is_array($setup)) { return ''; } return implode('', $this->cObjGetSeparated($setup, $addKey)); } /** * Rendering of a "numerical array" of cObjects from TypoScript
* @return string */ protected function generatePageBodyContent(TypoScriptFrontendController $controller): string { $pageContent = $controller->cObj->cObjGet($controller->pSetup) ?: ''; if ($controller->pSetup['wrap'] ?? false) { $pageContent = $controller->cObj->wrap($pageContent, $controller->pSetup['wrap']); } if ($controller->pSetup['stdWrap.'] ?? false) {
protected function generatePageContent(TypoScriptFrontendController $controller, ServerRequestInterface $request): string { // Generate the main content between the <body> tags // This has to be done first, as some additional TSFE-related code could have been written $pageContent = $this->generatePageBodyContent($controller); // If 'disableAllHeaderCode' is set, all the pageRenderer settings are not evaluated if ($controller->config['config']['disableAllHeaderCode'] ?? false) { return $pageContent; }
// Content generation $this->timeTracker->incStackPointer(); $this->timeTracker->push($controller->sPre, 'PAGE'); $controller->content = $this->generatePageContent($controller, $request); $this->timeTracker->pull($this->timeTracker->LR ? $controller->content : ''); $this->timeTracker->decStackPointer();
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { try { $response = $handler->handle($request); } catch (PropagateResponseException $e) { $response = $e->getResponse(); }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Throw away all output that may have happened during bootstrapping by weird extensions ob_clean(); // Initialize output compression if configured $this->initializeOutputCompression(); return $handler->handle($request); } /** * Initialize output compression if configured
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} else { // Track page view $this->trackPageview($fields, $extensionConfiguration); } return $handler->handle($request); } /** * @return array
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* @return ResponseInterface */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { if ( (!isset($GLOBALS['TSFE']->config['config']['enableContentLengthHeader']) || $GLOBALS['TSFE']->config['config']['enableContentLengthHeader']) && !$GLOBALS['TSFE']->isBackendUserLoggedIn() && !($GLOBALS['TYPO3_CONF_VARS']['FE']['debug'] ?? false)
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
); } } return $handler->handle($request); } protected function getRedirectUri(ServerRequestInterface $request): ?string {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->convertCharsetRecursivelyToUtf8($parsedBody, $controller->metaCharset); $request = $request->withParsedBody($parsedBody); } } $response = $handler->handle($request); /** * Release TSFE locks. They have been acquired in the above call to controller->getFromCache(). * TSFE locks are usually released by the RequestHandler 'final' middleware.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Make TSFE globally available // @todo deprecate $GLOBALS['TSFE'] once TSFE is retrieved from the // PSR-7 request attribute frontend.controller throughout TYPO3 core $GLOBALS['TSFE'] = $controller; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} } $request = $request->withAttribute('noCache', $this->disableCache); return $handler->handle($request); } /** * Filters out the arguments that are necessary for calculating cHash
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$previewAspect = GeneralUtility::makeInstance(PreviewAspect::class, $isPreview); $this->context->setAspect('frontend.preview', $previewAspect); } return $handler->handle($request); } /** * Simulate dates for preview functionality
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// merge the PageArguments with the request query parameters $queryParams = array_replace_recursive($request->getQueryParams(), $pageArguments->getArguments()); $request = $request->withQueryParams($queryParams); return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new HtmlResponse($content, 200, ['Content-Type' => $contentType]); } } return $handler->handle($request); } /** * Find the proper configuration for the static route in the static route configuration. Mainly:
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$uri = $requestedUri->withPath(rtrim($requestedUri->getPath(), '/')); return new RedirectResponse($uri, 307); } } return $handler->handle($request); } /** * Checks if the language is allowed in Frontend, if not, check if there is valid BE user
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return $response; } } return $handler->handle($request); } protected function buildRedirectResponse(UriInterface $uri, array $redirectRecord): ResponseInterface {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* request handler to do so. */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); $explanation = []; $skipProcessing = false; foreach (GeneralUtility::makeInstance(ObjectFactoryService::class)->get('CacheRule') as $rule) {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* request handler to do so. */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if (!$response->hasHeader('X-SFC-Cachable')) { return $this->removeSfcHeaders($response); }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Remove staticfilecache cookie when no backend or frontend user is logged in $this->cookieService->unsetCookie(); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $feUser = $request->getAttribute('frontend.user'); assert($feUser instanceof FrontendUserAuthentication); $response = $handler->handle($request); $weShouldHaveCookie = $this->weShouldHaveCookie($feUser, $request); $lifetime = (int)($GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'] ?? 0);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if ($this->context->getAspect('frontend.user')->isLoggedIn() && $rateLimiter) { $rateLimiter->reset(); } $response = $handler->handle($request); // Store session data for fe_users if it still exists if ($frontendUser instanceof FrontendUserAuthentication) { $frontendUser->storeSessionData();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
Bootstrap::loadExtTables(); $this->setBackendUserAspect($GLOBALS['BE_USER']); } $response = $handler->handle($request); // If, when building the response, the user is still available, then ensure that the headers are sent properly if ($this->context->getAspect('backend.user')->isLoggedIn()) { return $this->applyHeadersToResponse($response);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
) { return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($request, 'This page is temporarily unavailable.'); } // Continue the regular stack if no maintenance mode is active return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('routing', $routeResult); if ($routeResult->getLanguage() instanceof SiteLanguage) { Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage()); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
*/ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
1396795884 ); } return $handler->handle($request); } /** * Checks if the provided host header value matches the trusted hosts pattern.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->timeTracker->setEnabled($timeTrackingEnabled); $this->timeTracker->start(microtime(true)); $this->timeTracker->push(''); $response = $handler->handle($request); // Finish time tracking $this->timeTracker->pull(); $this->timeTracker->finish();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} catch (Exception $exception) { // Not handled } return $handler->handle($request); } /** * Handle the fallback.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
*/ public function handle(ServerRequestInterface $request): ResponseInterface { try { $response = $this->requestHandler->handle($request); } catch (ImmediateResponseException $exception) { $response = $exception->getResponse(); } return $response;
// Create new request object having applicationType "I am a frontend request" attribute. $request = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE); $this->initializeContext(); return parent::handle($request); } /** * Create a PSR-7 Response that redirects to the install tool
* @param callable $execute Deprecated, will be removed in TYPO3 v12.0 */ final public function run(callable $execute = null) { $response = $this->handle(ServerRequestFactory::fromGlobals()); if ($execute !== null) { trigger_error('Custom execution of Application code will be removed in TYPO3 v12.0, use PSR-15 Middlewares instead.', E_USER_DEPRECATED); $execute(); }
// Set up the application for the frontend call_user_func(static function () { $classLoader = require __DIR__.'/vendor/autoload.php'; \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); });
call_user_func(static function () { $classLoader = require __DIR__.'/vendor/autoload.php'; \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); });