‪TYPO3CMS  11.5
TemplateService.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Psr\Log\LogLevel;
28 use TYPO3\CMS\Core\Package\PackageManager;
39 
46 {
54  protected ‪$verbose = false;
55 
61  public ‪$tt_track = true;
62 
71  public ‪$matchAlternative = [];
72 
78  protected ‪$matchAll = false;
79 
83  public ‪$ext_constants_BRP = 0;
84 
88  public ‪$ext_config_BRP = 0;
89 
93  public ‪$ext_regLinenumbers = false;
94 
98  public ‪$ext_regComments = false;
99 
105  protected ‪$simulationHiddenOrTime = false;
106 
112  public ‪$loaded = false;
113 
117  public ‪$setup = [];
118 
122  public ‪$flatSetup = [];
123 
131  public ‪$config = [];
132 
138  public ‪$constants = [];
139 
145  protected ‪$templateIncludePaths = [];
146 
152  public ‪$hierarchyInfo = [];
153 
159  protected ‪$hierarchyInfoToRoot = [];
160 
166  protected ‪$rootId;
167 
173  public ‪$rootLine;
174 
181 
187  protected ‪$rowSum;
188 
194  public ‪$sections;
195 
201  protected ‪$sectionsMatch;
202 
207  public ‪$clearList_const = [];
208 
214  public ‪$clearList_setup = [];
215 
219  public ‪$parserErrors = [];
220 
224  public ‪$setup_constants = [];
225 
235  protected ‪$extensionStaticsProcessed = false;
236 
242  protected ‪$processExtensionStatics = false;
243 
251  protected ‪$isDefaultTypoScriptAdded = false;
252 
261  protected ‪$processIncludesHasBeenRun = false;
262 
268 
272  protected ‪$context;
273 
277  protected ‪$packageManager;
278 
282  protected ‪$frontendController;
283 
290  {
291  $this->context = ‪$context ?? GeneralUtility::makeInstance(Context::class);
292  $this->packageManager = ‪$packageManager ?? GeneralUtility::makeInstance(PackageManager::class);
293  $this->frontendController = ‪$frontendController;
295  if ($this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false) || ‪$GLOBALS['SIM_ACCESS_TIME'] !== ‪$GLOBALS['ACCESS_TIME']) {
296  // Set the simulation flag, if simulation is detected!
297  $this->simulationHiddenOrTime = true;
298  }
299  $this->tt_track = $this->verbose = (bool)$this->context->getPropertyFromAspect('backend.user', 'isLoggedIn', false);
300  }
301 
305  public function ‪getProcessExtensionStatics()
306  {
308  }
309 
314  {
315  $this->processExtensionStatics = (bool)‪$processExtensionStatics;
316  }
317 
322  public function ‪setVerbose(‪$verbose)
323  {
324  $this->verbose = (bool)‪$verbose;
325  }
326 
330  protected function ‪initializeDatabaseQueryRestrictions()
331  {
332  $this->queryBuilderRestrictions = GeneralUtility::makeInstance(DefaultRestrictionContainer::class);
333 
334  if ($this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false)) {
335  $this->queryBuilderRestrictions->removeByType(HiddenRestriction::class);
336  }
337  }
338 
359  public function ‪getCurrentPageData(int $pageId, string $mountPointValue)
360  {
361  return GeneralUtility::makeInstance(CacheManager::class)->getCache('pagesection')
362  ->get($pageId . '_' . $this->context->getPropertyFromAspect('language', 'id') . '_' . GeneralUtility::md5int($mountPointValue));
363  }
364 
371  public function ‪matching($cc)
372  {
373  if (is_array($cc['all'])) {
374  $matchObj = GeneralUtility::makeInstance(ConditionMatcher::class, null, null, null, $this->absoluteRootLine);
375  $matchObj->setRootline((array)($cc['rootLine'] ?? []));
376  ‪$sectionsMatch = [];
377  foreach ($cc['all'] as $key => $pre) {
378  if ($matchObj->match($pre)) {
379  ‪$sectionsMatch[$key] = $pre;
380  }
381  }
382  $cc['match'] = ‪$sectionsMatch;
383  }
384  return $cc;
385  }
386 
395  public function ‪start($theRootLine)
396  {
397  $cc = [];
398  if (is_array($theRootLine)) {
399  $constantsData = [];
400  $setupData = [];
401  $cacheIdentifier = '';
402  // Flag that indicates that the existing data in cache_pagesection
403  // could be used (this is the case if $TSFE->all is set, and the
404  // rowSum still matches). Based on this we decide if cache_pagesection
405  // needs to be updated...
406  $isCached = false;
407  $this->‪runThroughTemplates($theRootLine);
408  if ($this->‪getTypoScriptFrontendController()->all) {
409  $cc = $this->‪getTypoScriptFrontendController()->all;
410  // The two rowSums must NOT be different from each other - which they will be if start/endtime or hidden has changed!
411  if (serialize($this->rowSum) !== serialize($cc['rowSum'])) {
412  $cc = [];
413  } else {
414  // If $TSFE->all contains valid data, we don't need to update cache_pagesection (because this data was fetched from there already)
415  if (serialize($this->rootLine) === serialize($cc['rootLine'])) {
416  $isCached = true;
417  }
418  // When the data is serialized below (ROWSUM hash), it must not contain the rootline by concept. So this must be removed (and added again later)...
419  unset($cc['rootLine']);
420  }
421  }
422  // This is about getting the hash string which is used to fetch the cached TypoScript template.
423  // If there was some cached currentPageData ($cc) then that's good (it gives us the hash).
424  if (!empty($cc)) {
425  // If currentPageData was actually there, we match the result (if this wasn't done already in $TSFE->getFromCache()...)
426  if (!$cc['match']) {
427  // @todo check if this can ever be the case - otherwise remove
428  $cc = $this->‪matching($cc);
429  ksort($cc);
430  }
431  $cacheIdentifier = md5(serialize($cc));
432  } else {
433  // If currentPageData was not there, we first find $rowSum (freshly generated). After that we try to see, if it is stored with a list of all conditions. If so we match the result.
434  $rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
435  $result = $this->‪getCacheEntry($rowSumHash);
436  if (is_array($result)) {
437  $cc['all'] = $result;
438  $cc['rowSum'] = ‪$this->rowSum;
439  $cc = $this->‪matching($cc);
440  ksort($cc);
441  $cacheIdentifier = md5(serialize($cc));
442  }
443  }
444  if ($cacheIdentifier) {
445  // Get TypoScript setup array
446  $cachedData = $this->‪getCacheEntry($cacheIdentifier);
447  if (is_array($cachedData)) {
448  $constantsData = $cachedData['constants'];
449  $setupData = $cachedData['setup'];
450  }
451  }
452  if (!empty($setupData) && !$this->context->getPropertyFromAspect('typoscript', 'forcedTemplateParsing')) {
453  // TypoScript constants + setup are found in the cache
454  $this->setup_constants = $constantsData;
455  $this->setup = $setupData;
456  if ($this->tt_track) {
457  $this->‪getTimeTracker()->‪setTSlogMessage('Using cached TS template data', LogLevel::INFO);
458  }
459  } else {
460  if ($this->tt_track) {
461  $this->‪getTimeTracker()->‪setTSlogMessage('Not using any cached TS data', LogLevel::INFO);
462  }
463 
464  // Make configuration
465  $this->‪generateConfig();
466  // This stores the template hash thing
467  $cc = [];
468  // All sections in the template at this point is found
469  $cc['all'] = ‪$this->sections;
470  // The line of templates is collected
471  $cc['rowSum'] = ‪$this->rowSum;
472  $cc = $this->‪matching($cc);
473  ksort($cc);
474  $cacheIdentifier = md5(serialize($cc));
475  // This stores the data.
476  $this->‪setCacheEntry($cacheIdentifier, ['constants' => $this->setup_constants, 'setup' => $this->setup], 'TS_TEMPLATE');
477  if ($this->tt_track) {
478  $this->‪getTimeTracker()->‪setTSlogMessage('TS template size, serialized: ' . strlen(serialize($this->setup)) . ' bytes', LogLevel::INFO);
479  }
480  $rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
481  $this->‪setCacheEntry($rowSumHash, $cc['all'], 'TMPL_CONDITIONS_ALL');
482  }
483  // Add rootLine
484  $cc['rootLine'] = ‪$this->rootLine;
485  ksort($cc);
486  // Make global and save
487  $this->‪getTypoScriptFrontendController()->all = $cc;
488  // Matching must be executed for every request, so this must never be part of the pagesection cache!
489  unset($cc['match']);
490  if (!$isCached && !$this->simulationHiddenOrTime && !$this->‪getTypoScriptFrontendController()->no_cache) {
491  // Only save the data if we're not simulating by hidden/starttime/endtime
492  $mpvarHash = GeneralUtility::md5int($this->‪getTypoScriptFrontendController()->MP);
493  $pageSectionCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pagesection');
494  $pageSectionCache->set(
495  (int)$this->‪getTypoScriptFrontendController()->id . '_' . $this->context->getPropertyFromAspect('language', 'id') . '_' . $mpvarHash,
496  $cc,
497  [
498  'pageId_' . (int)$this->getTypoScriptFrontendController()->id,
499  'mpvarHash_' . $mpvarHash,
500  ]
501  );
502  }
503  // If everything OK.
504  if ($this->rootId && $this->rootLine && $this->setup) {
505  $this->loaded = true;
506  }
507  }
508  }
509 
510  /*******************************************************************
511  *
512  * Fetching TypoScript code text for the Template Hierarchy
513  *
514  *******************************************************************/
524  public function ‪runThroughTemplates($theRootLine, $start_template_uid = 0)
525  {
526  $this->constants = [];
527  $this->config = [];
528  $this->rowSum = [];
529  $this->hierarchyInfoToRoot = [];
530  $this->absoluteRootLine = $theRootLine;
531  $this->isDefaultTypoScriptAdded = false;
532 
533  reset($this->absoluteRootLine);
534  $c = count($this->absoluteRootLine);
535  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
536  for ($a = 0; $a < $c; $a++) {
537  $where = [
538  $queryBuilder->expr()->eq(
539  'pid',
540  $queryBuilder->createNamedParameter($this->absoluteRootLine[$a]['uid'], ‪Connection::PARAM_INT)
541  ),
542  ];
543  // If first loop AND there is set an alternative template uid, use that
544  if ($a === $c - 1 && $start_template_uid) {
545  $where[] = $queryBuilder->expr()->eq(
546  'uid',
547  $queryBuilder->createNamedParameter($start_template_uid, ‪Connection::PARAM_INT)
548  );
549  }
550  $queryBuilder->setRestrictions($this->queryBuilderRestrictions);
551  $queryResult = $queryBuilder
552  ->select('*')
553  ->from('sys_template')
554  ->where(...$where)
555  ->orderBy('root', 'DESC')
556  ->addOrderBy('sorting')
557  ->setMaxResults(1)
558  ->executeQuery();
559  if ($row = $queryResult->fetchAssociative()) {
560  $this->‪versionOL($row);
561  if (is_array($row)) {
562  $this->‪processTemplate($row, 'sys_' . $row['uid'], $this->absoluteRootLine[$a]['uid'], 'sys_' . $row['uid']);
563  }
564  }
565  $this->rootLine[] = $this->absoluteRootLine[$a];
566  }
567 
568  // Hook into the default TypoScript to add custom typoscript logic
569  $hookParameters = [
570  'extensionStaticsProcessed' => &‪$this->extensionStaticsProcessed,
571  'isDefaultTypoScriptAdded' => &‪$this->isDefaultTypoScriptAdded,
572  'absoluteRootLine' => &‪$this->absoluteRootLine,
573  'rootLine' => &‪$this->rootLine,
574  'startTemplateUid' => $start_template_uid,
575  'rowSum' => &‪$this->rowSum,
576  ];
577  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing'] ?? [] as $listener) {
578  GeneralUtility::callUserFunction($listener, $hookParameters, $this);
579  }
580 
581  // Process extension static files if not done yet, but explicitly requested
582  if (!$this->extensionStaticsProcessed && $this->processExtensionStatics) {
583  $this->‪addExtensionStatics('sys_0', 'sys_0', 0);
584  }
585 
586  // Add the global default TypoScript from the TYPO3_CONF_VARS
587  $this->‪addDefaultTypoScript();
588 
589  $this->‪processIncludes();
590  }
591 
604  public function ‪processTemplate($row, $idList, $pid, $templateID = '', $templateParent = '', $includePath = '')
605  {
606  // Adding basic template record information to rowSum array
607  $this->rowSum[] = [$row['uid'] ?? null, $row['title'] ?? null, $row['tstamp'] ?? null];
608  // Processing "Clear"-flags
609  $clConst = 0;
610  $clConf = 0;
611  if (!empty($row['clear'])) {
612  $clConst = $row['clear'] & 1;
613  $clConf = $row['clear'] & 2;
614  if ($clConst) {
615  // Keep amount of items to stay in sync with $this->templateIncludePaths so processIncludes() does not break
616  foreach ($this->constants as &$constantConfiguration) {
617  $constantConfiguration = '';
618  }
619  unset($constantConfiguration);
620  $this->clearList_const = [];
621  }
622  if ($clConf) {
623  // Keep amount of items to stay in sync with $this->templateIncludePaths so processIncludes() does not break
624  foreach ($this->config as &$configConfiguration) {
625  $configConfiguration = '';
626  }
627  unset($configConfiguration);
628  $this->hierarchyInfoToRoot = [];
629  $this->clearList_setup = [];
630  }
631  }
632  // Include files (from extensions) (#1/2)
633  // NORMAL inclusion, The EXACT same code is found below the basedOn inclusion!!!
634  if (!isset($row['includeStaticAfterBasedOn']) || !$row['includeStaticAfterBasedOn']) {
635  $this->‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row);
636  }
637  // Include "Based On" sys_templates:
638  // 'basedOn' is a list of templates to include
639  if (trim($row['basedOn'] ?? '')) {
640  // Normal Operation, which is to include the "based-on" sys_templates,
641  // if they are not already included, and maintaining the sorting of the templates
642  $basedOnIds = ‪GeneralUtility::intExplode(',', $row['basedOn'], true);
643  // skip template if it's already included
644  foreach ($basedOnIds as $key => $basedOnId) {
645  if (GeneralUtility::inList($idList, 'sys_' . $basedOnId)) {
646  unset($basedOnIds[$key]);
647  }
648  }
649  if (!empty($basedOnIds)) {
650  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
651  $queryBuilder->setRestrictions($this->queryBuilderRestrictions);
652  $queryResult = $queryBuilder
653  ->select('*')
654  ->from('sys_template')
655  ->where(
656  $queryBuilder->expr()->in(
657  'uid',
658  $queryBuilder->createNamedParameter($basedOnIds, Connection::PARAM_INT_ARRAY)
659  )
660  )
661  ->executeQuery();
662  // make it an associative array with the UID as key
663  $subTemplates = [];
664  while ($rowItem = $queryResult->fetchAssociative()) {
665  $subTemplates[(int)$rowItem['uid']] = $rowItem;
666  }
667  // Traversing list again to ensure the sorting of the templates
668  foreach ($basedOnIds as $id) {
669  if (is_array($subTemplates[$id] ?? false)) {
670  $this->‪versionOL($subTemplates[$id]);
671  $this->‪processTemplate($subTemplates[$id], $idList . ',sys_' . $id, $pid, 'sys_' . $id, $templateID);
672  }
673  }
674  }
675  }
676  // Include files (from extensions) (#2/2)
677  if (!empty($row['includeStaticAfterBasedOn'])) {
678  $this->‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row);
679  }
680  // Creating hierarchy information; Used by backend analysis tools
681  $this->hierarchyInfo[] = ($this->hierarchyInfoToRoot[] = [
682  'root' => trim($row['root'] ?? ''),
683  'clConst' => $clConst,
684  'clConf' => $clConf,
685  'templateID' => $templateID,
686  'templateParent' => $templateParent,
687  'title' => $row['title'],
688  'uid' => $row['uid'],
689  'pid' => $row['pid'] ?? null,
690  'configLines' => substr_count((string)$row['config'], LF) + 1,
691  ]);
692  // Adding the content of the fields constants (Constants) and config (Setup)
693  $this->constants[] = $row['constants'];
694  $this->config[] = $row['config'];
695  $this->templateIncludePaths[] = $includePath;
696  // For backend analysis (Template Analyzer) provide the order of added constants/config template IDs
697  $this->clearList_const[] = $templateID;
698  $this->clearList_setup[] = $templateID;
699  // If the template record is a Rootlevel record, set the flag and clear the template rootLine (so it starts over from this point)
700  if (trim($row['root'] ?? '')) {
701  $this->rootId = $pid;
702  $this->rootLine = [];
703  }
704  }
705 
716  public function ‪updateRootlineData($fullRootLine)
717  {
718  if (!is_array($this->rootLine) || empty($this->rootLine)) {
719  return;
720  }
721 
722  $fullRootLineByUid = [];
723  foreach ($fullRootLine as $rootLineData) {
724  $fullRootLineByUid[$rootLineData['uid']] = $rootLineData;
725  }
726 
727  foreach ($this->rootLine as $level => $dataArray) {
728  $currentUid = $dataArray['uid'];
729 
730  if (!array_key_exists($currentUid, $fullRootLineByUid)) {
731  throw new \RuntimeException(sprintf('The full rootLine does not contain data for the page with the uid %d that is contained in the template rootline.', $currentUid), 1370419654);
732  }
733 
734  $this->rootLine[$level] = $fullRootLineByUid[$currentUid];
735  }
736  }
737 
748  public function ‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row)
749  {
750  // Call function for link rendering:
751  $_params = [
752  'idList' => &$idList,
753  'templateId' => &$templateID,
754  'pid' => &$pid,
755  'row' => &$row,
756  ];
757  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'] ?? [] as $_funcRef) {
758  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
759  }
760  // If "Include before all static templates if root-flag is set" is set:
761  $staticFileMode = $row['static_file_mode'] ?? null;
762  if ($staticFileMode == 3 && strpos($templateID, 'sys_') === 0 && $row['root']) {
763  $this->‪addExtensionStatics($idList, $templateID, $pid);
764  }
765  // Static Template Files (Text files from extensions): include_static_file is a list of static files to include (from extensions)
766  if (trim($row['include_static_file'] ?? '')) {
767  $include_static_fileArr = ‪GeneralUtility::trimExplode(',', $row['include_static_file'], true);
768  // Traversing list
769  foreach ($include_static_fileArr as $ISF_file) {
770  if (‪PathUtility::isExtensionPath($ISF_file)) {
771  [$ISF_extKey, $ISF_localPath] = explode('/', substr($ISF_file, 4), 2);
772  if ((string)$ISF_extKey !== '' && ‪ExtensionManagementUtility::isLoaded($ISF_extKey) && (string)$ISF_localPath !== '') {
773  $ISF_localPath = rtrim($ISF_localPath, '/') . '/';
774  $ISF_filePath = ‪ExtensionManagementUtility::extPath($ISF_extKey) . $ISF_localPath;
775  if (@is_dir($ISF_filePath)) {
776  $mExtKey = str_replace('_', '', $ISF_extKey . '/' . $ISF_localPath);
777 
778  $includeStaticTxtPath = $ISF_filePath . 'include_static.txt';
779  $includeStaticTxtContents = '';
780  if (@file_exists($includeStaticTxtPath)) {
781  $includeStaticTxtContents = (string)file_get_contents($includeStaticTxtPath);
782  $includeStaticTxtContents = implode(',', array_unique(‪GeneralUtility::intExplode(',', $includeStaticTxtContents)));
783  }
784 
785  $includeStaticFileTxtPath = $ISF_filePath . 'include_static_file.txt';
786  $includeStaticFileTxtContents = '';
787  if (@file_exists($includeStaticFileTxtPath)) {
788  $includeStaticFileTxtContents = (string)file_get_contents($includeStaticFileTxtPath);
789  $includeStaticFileTxtContents = implode(',', array_unique(‪GeneralUtility::trimExplode(',', $includeStaticFileTxtContents)));
790  }
791 
792  $subrow = [
793  'constants' => $this->‪getTypoScriptSourceFileContent($ISF_filePath, 'constants'),
794  'config' => $this->‪getTypoScriptSourceFileContent($ISF_filePath, 'setup'),
795  'include_static' => $includeStaticTxtContents,
796  'include_static_file' => $includeStaticFileTxtContents,
797  'title' => $ISF_file,
798  'uid' => $mExtKey,
799  ];
800  $subrow = $this->‪prependStaticExtra($subrow);
801  $this->‪processTemplate($subrow, $idList . ',ext_' . $mExtKey, $pid, 'ext_' . $mExtKey, $templateID, $ISF_filePath);
802  }
803  }
804  }
805  }
806  }
807  // If "Default (include before if root flag is set)" is set OR
808  // "Always include before this template record" AND root-flag are set
809  if ($staticFileMode == 1 || $staticFileMode == 0 && strpos($templateID, 'sys_') === 0 && $row['root']) {
810  $this->‪addExtensionStatics($idList, $templateID, $pid);
811  }
812  // Include Static Template Records after all other TypoScript has been included.
813  $_params = [
814  'idList' => &$idList,
815  'templateId' => &$templateID,
816  'pid' => &$pid,
817  'row' => &$row,
818  ];
819  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'] ?? [] as $_funcRef) {
820  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
821  }
822  }
823 
832  protected function ‪getTypoScriptSourceFileContent($filePath, $baseName)
833  {
834  $extensions = ['.typoscript', '.ts', '.txt'];
835  foreach ($extensions as $extension) {
836  $fileName = $filePath . $baseName . $extension;
837  if (@file_exists($fileName)) {
838  return file_get_contents($fileName);
839  }
840  }
841  return '';
842  }
843 
853  public function ‪addExtensionStatics($idList, $templateID, $pid)
854  {
855  $this->extensionStaticsProcessed = true;
856 
857  foreach ($this->packageManager->getActivePackages() as $package) {
858  $extKey = $package->getPackageKey();
859  $packagePath = $package->getPackagePath();
860  $filesToCheck = [
861  'ext_typoscript_constants.txt',
862  'ext_typoscript_constants.typoscript',
863  'ext_typoscript_setup.txt',
864  'ext_typoscript_setup.typoscript',
865  ];
866  $files = [];
867  $hasExtensionStatics = false;
868  foreach ($filesToCheck as $file) {
869  $path = $packagePath . $file;
870  if (@file_exists($path)) {
871  $files[$file] = $path;
872  $hasExtensionStatics = true;
873  } else {
874  $files[$file] = null;
875  }
876  }
877 
878  if ($hasExtensionStatics) {
879  $mExtKey = str_replace('_', '', $extKey);
880  ‪$constants = '';
881  ‪$config = '';
882 
883  if (!empty($files['ext_typoscript_constants.typoscript'])) {
884  ‪$constants = @file_get_contents($files['ext_typoscript_constants.typoscript']);
885  } elseif (!empty($files['ext_typoscript_constants.txt'])) {
886  ‪$constants = @file_get_contents($files['ext_typoscript_constants.txt']);
887  }
888 
889  if (!empty($files['ext_typoscript_setup.typoscript'])) {
890  ‪$config = @file_get_contents($files['ext_typoscript_setup.typoscript']);
891  } elseif (!empty($files['ext_typoscript_setup.txt'])) {
892  ‪$config = @file_get_contents($files['ext_typoscript_setup.txt']);
893  }
894 
895  $this->‪processTemplate(
896  $this->‪prependStaticExtra([
897  'constants' => ‪$constants,
898  'config' => ‪$config,
899  'title' => $extKey,
900  'uid' => $mExtKey,
901  ]),
902  $idList . ',ext_' . $mExtKey,
903  $pid,
904  'ext_' . $mExtKey,
905  $templateID,
906  $packagePath
907  );
908  }
909  }
910  }
911 
921  protected function ‪prependStaticExtra($subrow)
922  {
923  // the identifier can be "43" if coming from "static template" extension or a path like "cssstyledcontent/static/"
924  $identifier = $subrow['uid'];
925  $subrow['config'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup.'][$identifier] ?? '';
926  $subrow['constants'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants.'][$identifier] ?? '';
927  // if this is a template of type "default content rendering", also see if other extensions have added their TypoScript that should be included after the content definitions
928  if (in_array($identifier, ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'], true)) {
929  $subrow['config'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup.']['defaultContentRendering'] ?? '';
930  $subrow['constants'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants.']['defaultContentRendering'] ?? '';
931  }
932  return $subrow;
933  }
934 
940  protected function ‪versionOL(&$row)
941  {
942  if ($this->context->getPropertyFromAspect('workspace', 'isOffline')) {
943  $pageRepository = GeneralUtility::makeInstance(PageRepository::class, $this->context);
944  $pageRepository->versionOL('sys_template', $row);
945  }
946  }
947 
948  /*******************************************************************
949  *
950  * Parsing TypoScript code text from Template Records into PHP array
951  *
952  *******************************************************************/
960  public function ‪generateConfig()
961  {
962  // Add default TS for all code types
963  $this->‪addDefaultTypoScript();
964 
965  // Parse the TypoScript code text for include-instructions!
966  $this->‪processIncludes();
967  // ****************************
968  // Parse TypoScript Constants
969  // ****************************
970  // Initialize parser and match-condition classes:
971  ‪$constants = GeneralUtility::makeInstance(TypoScriptParser::class);
972  $matchObj = GeneralUtility::makeInstance(ConditionMatcher::class);
973  $matchObj->setSimulateMatchConditions($this->matchAlternative);
974  $matchObj->setSimulateMatchResult((bool)$this->matchAll);
975  // Traverse constants text fields and parse them
976  foreach ($this->constants as $str) {
977  ‪$constants->parse($str, $matchObj);
978  }
979  // Read out parse errors if any
980  $this->parserErrors['constants'] = ‪$constants->errors;
981  // Then flatten the structure from a multi-dim array to a single dim array with all constants listed as key/value pairs (ready for substitution)
982  $this->flatSetup = ‪ArrayUtility::flatten(‪$constants->setup, '', true);
983  // ***********************************************
984  // Parse TypoScript Setup (here called "config")
985  // ***********************************************
986  // Initialize parser and match-condition classes:
987  ‪$config = GeneralUtility::makeInstance(TypoScriptParser::class);
988  ‪$config->regLinenumbers = ‪$this->ext_regLinenumbers;
989  ‪$config->regComments = ‪$this->ext_regComments;
990  ‪$config->setup = ‪$this->setup;
991  // Transfer information about conditions found in "Constants" and which of them returned TRUE.
992  ‪$config->sections = ‪$constants->sections;
993  ‪$config->sectionsMatch = ‪$constants->sectionsMatch;
994  // Traverse setup text fields and concatenate them into one, single string separated by a [GLOBAL] condition
995  $all = '';
996  foreach ($this->config as $str) {
997  $all .= '
998 [GLOBAL]
999 ' . $str;
1000  }
1001  // Substitute constants in the Setup code:
1002  if ($this->tt_track) {
1003  $this->‪getTimeTracker()->‪push('Substitute Constants (' . count($this->flatSetup) . ')');
1004  }
1005  $all = $this->‪substituteConstants($all);
1006  if ($this->tt_track) {
1007  $this->‪getTimeTracker()->‪pull();
1008  }
1009 
1010  // Searching for possible unsubstituted constants left (only for information)
1011  if ($this->verbose) {
1012  if (preg_match_all('/\\{\\$.[^}]*\\}/', $all, $constantList) > 0) {
1013  if ($this->tt_track) {
1014  $this->‪getTimeTracker()->‪setTSlogMessage(implode(', ', $constantList[0]) . ': Constants may remain un-substituted!!', LogLevel::WARNING);
1015  }
1016  }
1017  }
1018 
1019  // Logging the textual size of the TypoScript Setup field text with all constants substituted:
1020  if ($this->tt_track) {
1021  $this->‪getTimeTracker()->‪setTSlogMessage('TypoScript template size as textfile: ' . strlen($all) . ' bytes', LogLevel::INFO);
1022  }
1023  // Finally parse the Setup field TypoScript code (where constants are now substituted)
1024  ‪$config->parse($all, $matchObj);
1025  // Read out parse errors if any
1026  $this->parserErrors['config'] = ‪$config->errors;
1027  // Transfer the TypoScript array from the parser object to the internal $this->setup array:
1028  $this->setup = ‪$config->setup;
1029  // Do the same for the constants
1030  $this->setup_constants = ‪$constants->setup;
1031  // ****************************************************************
1032  // Final processing of the $this->setup TypoScript Template array
1033  // Basically: This is unsetting/setting of certain reserved keys.
1034  // ****************************************************************
1035  // These vars are already set after 'processTemplate', but because $config->setup overrides them (in the line above!), we set them again. They are not changed compared to the value they had in the top of the page!
1036  unset($this->setup['types.']);
1037  unset($this->setup['types']);
1038  if (is_array($this->setup)) {
1039  foreach ($this->setup as $key => $value) {
1040  if ($value === 'PAGE') {
1041  // Set the typeNum of the current page object:
1042  if (isset($this->setup[$key . '.']['typeNum'])) {
1043  $typeNum = $this->setup[$key . '.']['typeNum'];
1044  $this->setup['types.'][$typeNum] = $key;
1045  } elseif (!isset($this->setup['types.'][0]) || !$this->setup['types.'][0]) {
1046  $this->setup['types.'][0] = $key;
1047  }
1048  }
1049  }
1050  }
1051  unset($this->setup['temp.']);
1052  unset(‪$constants);
1053  // Storing the conditions found/matched information:
1054  $this->sections = ‪$config->sections;
1055  $this->sectionsMatch = ‪$config->sectionsMatch;
1056  }
1057 
1066  protected function ‪processIncludes()
1067  {
1068  if ($this->processIncludesHasBeenRun) {
1069  return;
1070  }
1071 
1073  $files = [];
1074  foreach ($this->constants as &$value) {
1075  $includeData = ‪TypoScriptParser::checkIncludeLines($value, 1, true, array_shift($paths));
1076  $files = array_merge($files, $includeData['files']);
1077  $value = $includeData['typoscript'];
1078  }
1079  unset($value);
1081  foreach ($this->config as &$value) {
1082  $includeData = ‪TypoScriptParser::checkIncludeLines($value, 1, true, array_shift($paths));
1083  $files = array_merge($files, $includeData['files']);
1084  $value = $includeData['typoscript'];
1085  }
1086  unset($value);
1087 
1088  if (!empty($files)) {
1089  $files = array_unique($files);
1090  foreach ($files as $file) {
1091  $this->rowSum[] = [$file, filemtime($file)];
1092  }
1093  }
1094 
1095  $this->processIncludesHasBeenRun = true;
1096  }
1105  protected function ‪substituteConstants($all)
1106  {
1107  if ($this->tt_track) {
1108  $this->‪getTimeTracker()->‪setTSlogMessage('Constants to substitute: ' . count($this->flatSetup), LogLevel::INFO);
1109  }
1110  $noChange = false;
1111  // Recursive substitution of constants (up to 10 nested levels)
1112  for ($i = 0; $i < 10 && !$noChange; $i++) {
1113  $old_all = $all;
1114  $all = preg_replace_callback('/\\{\\$(.[^}]*)\\}/', [$this, 'substituteConstantsCallBack'], $all) ?? '';
1115  if ($old_all == $all) {
1116  $noChange = true;
1117  }
1118  }
1119  return $all;
1120  }
1121 
1130  public function ‪substituteConstantsCallBack($matches)
1131  {
1132  // Replace {$CONST} if found in $this->flatSetup, else leave unchanged
1133  return isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? $this->flatSetup[$matches[1]] : $matches[0];
1134  }
1135 
1136  /*******************************************************************
1137  *
1138  * Various API functions, used from elsewhere in the frontend classes
1139  *
1140  *******************************************************************/
1141 
1148  public function ‪getRootlineLevel($list)
1149  {
1150  $idx = 0;
1151  foreach ($this->rootLine as $page) {
1152  if (GeneralUtility::inList($list, $page['uid'])) {
1153  return $idx;
1154  }
1155  $idx++;
1156  }
1157  return false;
1158  }
1159 
1165  public function ‪getRootId(): int
1166  {
1167  return (int)‪$this->rootId;
1168  }
1169 
1170  /*******************************************************************
1171  *
1172  * Functions for creating links
1173  *
1174  *******************************************************************/
1182  protected function ‪addDefaultTypoScript()
1183  {
1184  // Add default TS for all code types, if not done already
1185  if (!$this->isDefaultTypoScriptAdded) {
1186  $rootTemplateId = $this->hierarchyInfo[count($this->hierarchyInfo) - 1]['templateID'] ?? null;
1187 
1188  // adding constants from site settings
1189  $siteConstants = '';
1190  if ($this->‪getTypoScriptFrontendController() instanceof TypoScriptFrontendController) {
1191  $site = $this->‪getTypoScriptFrontendController()->‪getSite();
1192  } else {
1193  $possibleRoots = array_filter($this->absoluteRootLine, static function (array $page) {
1194  return $page['is_siteroot'] === 1;
1195  });
1196  $possibleRoots[] = end($this->absoluteRootLine);
1197  $site = null;
1198  foreach ($possibleRoots as $possibleRoot) {
1199  try {
1200  $site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId((int)($possibleRoot['uid'] ?? 0));
1201  break;
1202  } catch (SiteNotFoundException $exception) {
1203  // continue
1204  }
1205  }
1206  }
1207  if ($site instanceof Site) {
1208  $siteSettings = $site->getConfiguration()['settings'] ?? [];
1209  if (!empty($siteSettings)) {
1210  $siteSettings = ‪ArrayUtility::flattenPlain($siteSettings);
1211  foreach ($siteSettings as $k => $v) {
1212  $siteConstants .= $k . ' = ' . $v . LF;
1213  }
1214  }
1215  }
1216 
1217  if ($siteConstants !== '') {
1218  // the count of elements in ->constants, ->config and ->templateIncludePaths have to be in sync
1219  array_unshift($this->constants, $siteConstants);
1220  array_unshift($this->config, '');
1221  array_unshift($this->templateIncludePaths, '');
1222  // prepare a proper entry to hierachyInfo (used by TemplateAnalyzer in BE)
1223  $defaultTemplateInfo = [
1224  'root' => '',
1225  'clConst' => '',
1226  'clConf' => '',
1227  'templateID' => '_siteConstants_',
1228  'templateParent' => $rootTemplateId,
1229  'title' => 'Site settings',
1230  'uid' => '_siteConstants_',
1231  'pid' => '',
1232  'configLines' => 0,
1233  ];
1234  // push info to information arrays used in BE by TemplateTools (Analyzer)
1235  array_unshift($this->clearList_const, $defaultTemplateInfo['uid']);
1236  array_unshift($this->clearList_setup, $defaultTemplateInfo['uid']);
1237  array_unshift($this->hierarchyInfo, $defaultTemplateInfo);
1238  }
1239 
1240  // adding default setup and constants
1241  // defaultTypoScript_setup is *very* unlikely to be empty
1242  // the count of elements in ->constants, ->config and ->templateIncludePaths have to be in sync
1243  array_unshift($this->constants, (string)‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']);
1244  array_unshift($this->config, (string)‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']);
1245  array_unshift($this->templateIncludePaths, '');
1246  // prepare a proper entry to hierachyInfo (used by TemplateAnalyzer in BE)
1247  $defaultTemplateInfo = [
1248  'root' => '',
1249  'clConst' => '',
1250  'clConf' => '',
1251  'templateID' => '_defaultTypoScript_',
1252  'templateParent' => $rootTemplateId,
1253  'title' => 'SYS:TYPO3_CONF_VARS:FE:defaultTypoScript',
1254  'uid' => '_defaultTypoScript_',
1255  'pid' => '',
1256  'configLines' => substr_count((string)‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'], LF) + 1,
1257  ];
1258  // push info to information arrays used in BE by TemplateTools (Analyzer)
1259  array_unshift($this->clearList_const, $defaultTemplateInfo['uid']);
1260  array_unshift($this->clearList_setup, $defaultTemplateInfo['uid']);
1261  array_unshift($this->hierarchyInfo, $defaultTemplateInfo);
1262 
1263  $this->isDefaultTypoScriptAdded = true;
1264  }
1265  }
1266 
1270  protected function ‪getTypoScriptFrontendController()
1271  {
1272  return $this->frontendController ?? ‪$GLOBALS['TSFE'] ?? null;
1273  }
1274 
1278  protected function ‪getTimeTracker()
1279  {
1280  return GeneralUtility::makeInstance(TimeTracker::class);
1281  }
1282 
1290  protected function ‪getCacheEntry($identifier)
1291  {
1292  return GeneralUtility::makeInstance(CacheManager::class)->getCache('hash')->get($identifier);
1293  }
1294 
1302  protected function ‪setCacheEntry($identifier, $data, $tag)
1303  {
1304  GeneralUtility::makeInstance(CacheManager::class)->getCache('hash')->set($identifier, $data, ['ident_' . $tag], 0);
1305  }
1306 }
‪TYPO3\CMS\Core\Utility\ArrayUtility\flatten
‪static array flatten(array $array, $prefix='', bool $keepDots=false)
Definition: ArrayUtility.php:486
‪TYPO3\CMS\Core\TypoScript\TemplateService\processIncludes
‪processIncludes()
Definition: TemplateService.php:1033
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_config_BRP
‪$ext_config_BRP
Definition: TemplateService.php:84
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:999
‪TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction
Definition: HiddenRestriction.php:27
‪TYPO3\CMS\Core\TypoScript\TemplateService\$constants
‪array $constants
Definition: TemplateService.php:126
‪TYPO3\CMS\Core\TypoScript\TemplateService\addDefaultTypoScript
‪addDefaultTypoScript()
Definition: TemplateService.php:1149
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:25
‪TYPO3\CMS\Core\Database\Connection\PARAM_INT
‪const PARAM_INT
Definition: Connection.php:49
‪TYPO3\CMS\Core\TypoScript\TemplateService\setVerbose
‪setVerbose($verbose)
Definition: TemplateService.php:289
‪TYPO3\CMS\Core\TypoScript\TemplateService\substituteConstants
‪string substituteConstants($all)
Definition: TemplateService.php:1072
‪TYPO3\CMS\Core\TypoScript\TemplateService\$clearList_setup
‪array $clearList_setup
Definition: TemplateService.php:191
‪TYPO3\CMS\Core\TypoScript\TemplateService\$context
‪Context $context
Definition: TemplateService.php:241
‪TYPO3\CMS\Core\TypoScript\TemplateService\substituteConstantsCallBack
‪string substituteConstantsCallBack($matches)
Definition: TemplateService.php:1097
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
Definition: TypoScriptParser.php:36
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage
‪setTSlogMessage($content, $logLevel=LogLevel::INFO)
Definition: TimeTracker.php:226
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getSite
‪getSite()
Definition: TypoScriptFrontendController.php:3596
‪TYPO3\CMS\Core\Utility\PathUtility\isExtensionPath
‪static bool isExtensionPath(string $path)
Definition: PathUtility.php:121
‪TYPO3\CMS\Core\TypoScript\TemplateService\$flatSetup
‪array $flatSetup
Definition: TemplateService.php:112
‪TYPO3\CMS\Core\TypoScript\TemplateService\prependStaticExtra
‪array prependStaticExtra($subrow)
Definition: TemplateService.php:888
‪TYPO3\CMS\Core\TypoScript\TemplateService\$parserErrors
‪array $parserErrors
Definition: TemplateService.php:195
‪TYPO3\CMS\Core\Exception\SiteNotFoundException
Definition: SiteNotFoundException.php:25
‪TYPO3\CMS\Core\Site\SiteFinder
Definition: SiteFinder.php:31
‪TYPO3\CMS\Core\TypoScript\TemplateService\$tt_track
‪bool $tt_track
Definition: TemplateService.php:59
‪TYPO3\CMS\Core\TypoScript\TemplateService\$hierarchyInfo
‪array $hierarchyInfo
Definition: TemplateService.php:138
‪TYPO3\CMS\Core\TypoScript\TemplateService\$processExtensionStatics
‪bool $processExtensionStatics
Definition: TemplateService.php:215
‪TYPO3\CMS\Core\TypoScript\TemplateService\$matchAll
‪bool $matchAll
Definition: TemplateService.php:74
‪TYPO3\CMS\Core\TypoScript\TemplateService\$packageManager
‪PackageManager $packageManager
Definition: TemplateService.php:245
‪TYPO3\CMS\Core\TypoScript\TemplateService\getCacheEntry
‪mixed getCacheEntry($identifier)
Definition: TemplateService.php:1257
‪TYPO3\CMS\Core\TypoScript\TemplateService\getProcessExtensionStatics
‪bool getProcessExtensionStatics()
Definition: TemplateService.php:272
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Core\TypoScript\TemplateService\$setup_constants
‪array $setup_constants
Definition: TemplateService.php:199
‪TYPO3\CMS\Core\TypoScript\TemplateService\runThroughTemplates
‪runThroughTemplates($theRootLine, $start_template_uid=0)
Definition: TemplateService.php:491
‪TYPO3\CMS\Core\TypoScript\TemplateService\__construct
‪__construct(Context $context=null, PackageManager $packageManager=null, TypoScriptFrontendController $frontendController=null)
Definition: TemplateService.php:256
‪TYPO3\CMS\Core\TypoScript\TemplateService\versionOL
‪versionOL(&$row)
Definition: TemplateService.php:907
‪TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources
‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row)
Definition: TemplateService.php:715
‪TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptSourceFileContent
‪string getTypoScriptSourceFileContent($filePath, $baseName)
Definition: TemplateService.php:799
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:42
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:43
‪TYPO3\CMS\Core\TypoScript\TemplateService\processTemplate
‪processTemplate($row, $idList, $pid, $templateID='', $templateParent='', $includePath='')
Definition: TemplateService.php:571
‪TYPO3\CMS\Core\TypoScript
Definition: ExtendedTemplateService.php:16
‪TYPO3\CMS\Core\TypoScript\TemplateService\$simulationHiddenOrTime
‪bool $simulationHiddenOrTime
Definition: TemplateService.php:98
‪TYPO3\CMS\Core\TypoScript\TemplateService\setCacheEntry
‪setCacheEntry($identifier, $data, $tag)
Definition: TemplateService.php:1269
‪TYPO3\CMS\Core\TypoScript\TemplateService\$frontendController
‪TypoScriptFrontendController null $frontendController
Definition: TemplateService.php:249
‪TYPO3\CMS\Core\TypoScript\TemplateService\$hierarchyInfoToRoot
‪array $hierarchyInfoToRoot
Definition: TemplateService.php:144
‪TYPO3\CMS\Core\TypoScript\TemplateService\$isDefaultTypoScriptAdded
‪bool $isDefaultTypoScriptAdded
Definition: TemplateService.php:223
‪TYPO3\CMS\Core\Utility\ArrayUtility\flattenPlain
‪static array flattenPlain(array $array)
Definition: ArrayUtility.php:515
‪TYPO3\CMS\Core\TypoScript\TemplateService\$processIncludesHasBeenRun
‪bool $processIncludesHasBeenRun
Definition: TemplateService.php:232
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_regComments
‪bool $ext_regComments
Definition: TemplateService.php:92
‪TYPO3\CMS\Core\TypoScript\TemplateService\addExtensionStatics
‪addExtensionStatics($idList, $templateID, $pid)
Definition: TemplateService.php:820
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_regLinenumbers
‪bool $ext_regLinenumbers
Definition: TemplateService.php:88
‪TYPO3\CMS\Core\TypoScript\TemplateService\getRootId
‪int getRootId()
Definition: TemplateService.php:1132
‪TYPO3\CMS\Core\TypoScript\TemplateService\matching
‪array matching($cc)
Definition: TemplateService.php:338
‪TYPO3\CMS\Core\TypoScript\TemplateService\$matchAlternative
‪array $matchAlternative
Definition: TemplateService.php:68
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser\checkIncludeLines
‪static string array checkIncludeLines($string, $cycle_counter=1, $returnFiles=false, $parentFilenameOrPath='')
Definition: TypoScriptParser.php:680
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\pull
‪pull($content='')
Definition: TimeTracker.php:206
‪TYPO3\CMS\Core\TypoScript\TemplateService\$rowSum
‪array $rowSum
Definition: TemplateService.php:168
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:36
‪TYPO3\CMS\Core\TypoScript\TemplateService\getCurrentPageData
‪array getCurrentPageData(int $pageId, string $mountPointValue)
Definition: TemplateService.php:326
‪TYPO3\CMS\Core\TypoScript\TemplateService\initializeDatabaseQueryRestrictions
‪initializeDatabaseQueryRestrictions()
Definition: TemplateService.php:297
‪TYPO3\CMS\Core\TypoScript\TemplateService\$config
‪array $config
Definition: TemplateService.php:120
‪TYPO3\CMS\Core\TypoScript\TemplateService\$extensionStaticsProcessed
‪bool $extensionStaticsProcessed
Definition: TemplateService.php:209
‪TYPO3\CMS\Core\TypoScript\TemplateService\$templateIncludePaths
‪array $templateIncludePaths
Definition: TemplateService.php:132
‪TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
Definition: ConditionMatcher.php:30
‪TYPO3\CMS\Core\TypoScript\TemplateService\$setup
‪array $setup
Definition: TemplateService.php:108
‪TYPO3\CMS\Core\TypoScript\TemplateService\updateRootlineData
‪updateRootlineData($fullRootLine)
Definition: TemplateService.php:683
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:38
‪TYPO3\CMS\Core\TypoScript\TemplateService\$sectionsMatch
‪array $sectionsMatch
Definition: TemplateService.php:180
‪TYPO3\CMS\Core\TypoScript\TemplateService\setProcessExtensionStatics
‪setProcessExtensionStatics($processExtensionStatics)
Definition: TemplateService.php:280
‪TYPO3\CMS\Core\TypoScript\TemplateService
Definition: TemplateService.php:46
‪TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer
Definition: AbstractRestrictionContainer.php:28
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:104
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\TypoScript\TemplateService\$clearList_const
‪string[] $clearList_const
Definition: TemplateService.php:185
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_constants_BRP
‪$ext_constants_BRP
Definition: TemplateService.php:79
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:927
‪TYPO3\CMS\Core\TypoScript\TemplateService\$loaded
‪bool $loaded
Definition: TemplateService.php:104
‪TYPO3\CMS\Core\TypoScript\TemplateService\$rootLine
‪array $rootLine
Definition: TemplateService.php:156
‪TYPO3\CMS\Core\TypoScript\TemplateService\$sections
‪array null $sections
Definition: TemplateService.php:174
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath
‪static string extPath($key, $script='')
Definition: ExtensionManagementUtility.php:142
‪TYPO3\CMS\Core\TypoScript\TemplateService\$absoluteRootLine
‪array $absoluteRootLine
Definition: TemplateService.php:162
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:53
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\TypoScript\TemplateService\$verbose
‪bool $verbose
Definition: TemplateService.php:53
‪TYPO3\CMS\Core\TypoScript\TemplateService\$rootId
‪int $rootId
Definition: TemplateService.php:150
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Core\TypoScript\TemplateService\getRootlineLevel
‪int getRootlineLevel($list)
Definition: TemplateService.php:1115
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key)
Definition: ExtensionManagementUtility.php:114
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:31
‪TYPO3\CMS\Core\TypoScript\TemplateService\start
‪start($theRootLine)
Definition: TemplateService.php:362
‪TYPO3\CMS\Core\TypoScript\TemplateService\$queryBuilderRestrictions
‪AbstractRestrictionContainer $queryBuilderRestrictions
Definition: TemplateService.php:237
‪TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController
‪TypoScriptFrontendController null getTypoScriptFrontendController()
Definition: TemplateService.php:1237
‪TYPO3\CMS\Core\TypoScript\TemplateService\getTimeTracker
‪TimeTracker getTimeTracker()
Definition: TemplateService.php:1245
‪TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer
Definition: DefaultRestrictionContainer.php:24
‪TYPO3\CMS\Core\TypoScript\TemplateService\generateConfig
‪generateConfig()
Definition: TemplateService.php:927
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\push
‪push($tslabel, $value='')
Definition: TimeTracker.php:179