2 namespace TYPO3\CMS\Frontend\Http;
89 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tslib/index_ts.php'][
'preprocessRequest'])) {
90 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tslib/index_ts.php'][
'preprocessRequest'] as $hookFunction) {
91 $hookParameters = array();
95 unset($hookParameters);
100 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'pageUnavailable_force']
103 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'devIPmask'])
105 $this->controller->pageUnavailableAndExit(
'This page is temporarily unavailable.');
108 $this->controller->connectToDB();
109 $this->controller->sendRedirect();
113 $this->bootstrap->endOutputBufferingAndCleanPreviousOutput();
117 $this->timeTracker->push(
'Front End user initialized',
'');
118 $this->controller->initFEuser();
119 $this->timeTracker->pull();
123 $GLOBALS[
'BE_USER'] = $this->controller->initializeBackendUser();
128 $this->timeTracker->push(
'Process ID',
'');
130 if ($this->controller->isBackendUserLoggedIn()) {
131 $GLOBALS[
'BE_USER']->initializeAdminPanel();
133 ->initializeBackendRouter()
134 ->loadExtensionTables(
true);
136 $this->bootstrap->loadCachedTca();
138 $this->controller->checkAlternativeIdMethods();
139 $this->controller->clear_preview();
140 $this->controller->determineId();
146 $this->controller->isBackendUserLoggedIn()
151 $this->controller->beUserLogin =
false;
153 $this->controller->checkAlternativeIdMethods();
154 $this->controller->clear_preview();
155 $this->controller->determineId();
158 $this->controller->makeCacheHash();
159 $this->timeTracker->pull();
162 if ($this->controller->isBackendUserLoggedIn()) {
163 $GLOBALS[
'BE_USER']->initializeFrontendEdit();
164 if (
$GLOBALS[
'BE_USER']->adminPanel instanceof AdminPanelView) {
166 ->initializeLanguageObject()
167 ->initializeSpriteManager();
169 if (
$GLOBALS[
'BE_USER']->frontendEdit instanceof FrontendEditingController) {
170 $GLOBALS[
'BE_USER']->frontendEdit->initConfigOptions();
175 $this->timeTracker->push(
'Start Template',
'');
176 $this->controller->initTemplate();
177 $this->timeTracker->pull();
179 $this->timeTracker->push(
'Get Page from cache',
'');
180 $this->controller->getFromCache();
181 $this->timeTracker->pull();
184 $this->controller->getConfigArray();
186 $this->timeTracker->push(
'Setting language and locale',
'');
187 $this->controller->settingLanguage();
188 $this->controller->settingLocale();
189 $this->timeTracker->pull();
192 $this->controller->convPOSTCharset();
194 $this->controller->initializeRedirectUrlHandlers();
196 $this->controller->handleDataSubmission();
199 $this->controller->checkPageForShortcutRedirect();
200 $this->controller->checkPageForMountpointRedirect();
203 $this->controller->setUrlIdToken();
204 $this->timeTracker->push(
'Page generation',
'');
205 if ($this->controller->isGeneratePage()) {
206 $this->controller->generatePage_preProcessing();
207 $temp_theScript = $this->controller->generatePage_whichScript();
208 if ($temp_theScript) {
209 include $temp_theScript;
211 PageGenerator::pagegenInit();
213 $this->controller->newCObj();
215 if (!$this->controller->isINTincScript()) {
216 PageGenerator::renderContent();
217 $this->controller->setAbsRefPrefix();
220 $this->controller->generatePage_postProcessing();
221 }
elseif ($this->controller->isINTincScript()) {
222 PageGenerator::pagegenInit();
224 $this->controller->newCObj();
226 $this->controller->releaseLocks();
227 $this->timeTracker->pull();
230 if ($this->controller->isINTincScript()) {
231 $this->timeTracker->push(
'Non-cached objects',
'');
232 $this->controller->INTincScript();
233 $this->timeTracker->pull();
237 $sendTSFEContent =
false;
238 if ($this->controller->isOutputting()) {
239 $this->timeTracker->push(
'Print Content',
'');
240 $this->controller->processOutput();
241 $sendTSFEContent =
true;
242 $this->timeTracker->pull();
245 $this->controller->storeSessionData();
247 $GLOBALS[
'TYPO3_MISC'][
'microtime_end'] = microtime(
true);
248 $this->controller->setParseTime();
249 if (isset($this->controller->config[
'config'][
'debug'])) {
250 $debugParseTime = (bool)$this->controller->config[
'config'][
'debug'];
252 $debugParseTime = !empty($this->controller->TYPO3_CONF_VARS[
'FE'][
'debug']);
254 if ($this->controller->isOutputting() && $debugParseTime) {
255 $this->controller->content .= LF .
'<!-- Parsetime: ' . $this->controller->scriptParseTime .
'ms -->';
257 $this->controller->redirectToExternalUrl();
259 $this->controller->previewInfo();
261 $this->controller->hook_eofe();
263 $this->timeTracker->pull();
265 MonitorUtility::peakMemoryUsage();
267 echo $this->controller->beLoginLinkIPList();
270 if ($this->controller->isBackendUserLoggedIn() &&
$GLOBALS[
'BE_USER'] instanceof FrontendBackendUserAuthentication) {
271 if (
$GLOBALS[
'BE_USER']->extAdmEnabled) {
273 $this->controller->content = str_ireplace(
'</head>',
$GLOBALS[
'BE_USER']->adminPanel->getAdminPanelHeaderData() .
'</head>', $this->controller->content);
275 if (
$GLOBALS[
'BE_USER']->isAdminPanelVisible()) {
276 $this->controller->content = str_ireplace(
'</body>',
$GLOBALS[
'BE_USER']->displayAdminPanel() .
'</body>', $this->controller->content);
280 if ($sendTSFEContent) {
283 $response->getBody()->write($this->controller->content);
286 if (isset(
$GLOBALS[
'error']) && is_object(
$GLOBALS[
'error']) && @is_callable(array(
$GLOBALS[
'error'],
'debugOutput'))) {
303 return $request->getQueryParams()[
'eID'] || $request->getParsedBody()[
'eID'] ?
false :
true;
323 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'compressionLevel'] && extension_loaded(
'zlib')) {
325 @ini_set(
'zlib.output_compression_level',
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'compressionLevel']);
338 $configuredCookieName = trim(
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'cookieName']);
339 if (empty($configuredCookieName)) {
340 $configuredCookieName =
'be_typo_user';
342 if ($this->request->getCookieParams()[$configuredCookieName]) {
353 $this->timeTracker->start();
364 TypoScriptFrontendController::class,