Skip to content
Snippets Groups Projects
Commit 7a0b88dc authored by Helmut Hummel's avatar Helmut Hummel Committed by Markus Klein
Browse files

[TASK] Simplify frontend page generation code

The additional isINTincScript check stems from the time
where this code was in a separate file, which
was included two times and page generation should be
skipped for the second inclusion. As INT scripts are only generated
during page rendering (or when fetching the page from cache)
we can safely remove this condition now.

Additionally, we can now easily get rid of the elseif
and move the page rendering preparation directly
after the same condition is checked later in the code flow.

This is fine, because this code does not need to be
executed before the lock is released. Last but not least
we clean up admin panel messages to clearly distinguish
between page generation and rendering preparation.

As this is a pure non breaking cleanup, this can
safely go into 8.7 branch as well.

Resolves: #84945
Releases: master, 8.7
Change-Id: If12b82a549d4cc47619c46f73c5423df70621b1b
Reviewed-on: https://review.typo3.org/56884


Reviewed-by: default avatarDaniel Goerz <ervaude@gmail.com>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: default avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
parent 2cdbfde9
Branches
Tags
No related merge requests found
...@@ -3248,6 +3248,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface ...@@ -3248,6 +3248,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
*/ */
public function preparePageContentGeneration() public function preparePageContentGeneration()
{ {
$this->getTimeTracker()->push('Prepare page content generation');
if ($this->page['content_from_pid'] > 0) { if ($this->page['content_from_pid'] > 0) {
// make REAL copy of TSFE object - not reference! // make REAL copy of TSFE object - not reference!
$temp_copy_TSFE = clone $this; $temp_copy_TSFE = clone $this;
...@@ -3329,6 +3330,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface ...@@ -3329,6 +3330,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
// Global content object // Global content object
$this->newCObj(); $this->newCObj();
$this->getTimeTracker()->pull();
} }
/** /**
......
...@@ -74,25 +74,22 @@ class RequestHandler implements RequestHandlerInterface, PsrRequestHandlerInterf ...@@ -74,25 +74,22 @@ class RequestHandler implements RequestHandlerInterface, PsrRequestHandlerInterf
// Generate page // Generate page
$controller->setUrlIdToken(); $controller->setUrlIdToken();
$this->timeTracker->push('Page generation', '');
if ($controller->isGeneratePage()) { if ($controller->isGeneratePage()) {
$this->timeTracker->push('Page generation');
$controller->generatePage_preProcessing(); $controller->generatePage_preProcessing();
$controller->preparePageContentGeneration(); $controller->preparePageContentGeneration();
// Content generation // Content generation
if (!$controller->isINTincScript()) { PageGenerator::renderContent();
PageGenerator::renderContent(); $controller->setAbsRefPrefix();
$controller->setAbsRefPrefix();
}
$controller->generatePage_postProcessing(); $controller->generatePage_postProcessing();
} elseif ($controller->isINTincScript()) { $this->timeTracker->pull();
$controller->preparePageContentGeneration();
} }
$controller->releaseLocks(); $controller->releaseLocks();
$this->timeTracker->pull();
// Render non-cached parts // Render non-cached page parts by replacing placeholders which are taken from cache or added during page generation
if ($controller->isINTincScript()) { if ($controller->isINTincScript()) {
$this->timeTracker->push('Non-cached objects', ''); $controller->preparePageContentGeneration();
$this->timeTracker->push('Non-cached objects');
$controller->INTincScript(); $controller->INTincScript();
$this->timeTracker->pull(); $this->timeTracker->pull();
} }
......
...@@ -62,6 +62,7 @@ class PrepareTypoScriptFrontendRendering implements MiddlewareInterface ...@@ -62,6 +62,7 @@ class PrepareTypoScriptFrontendRendering implements MiddlewareInterface
$this->timeTracker->pull(); $this->timeTracker->pull();
// Get from cache // Get from cache
$this->timeTracker->push('Get Page from cache', ''); $this->timeTracker->push('Get Page from cache', '');
// Locks may be acquired here
$this->controller->getFromCache(); $this->controller->getFromCache();
$this->timeTracker->pull(); $this->timeTracker->pull();
// Get config if not already gotten // Get config if not already gotten
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment