‪TYPO3CMS  10.4
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 
29 use TYPO3\CMS\Core\Package\PackageManager;
39 
46 {
48 
53  'forceTemplateParsing' => 'Using tmpl->forceTemplateParsing is deprecated and will no longer work with TYPO3 v11.0. Use TypoScriptAspect from Context instead.'
54  ];
55 
63  protected ‪$verbose = false;
64 
70  public ‪$tt_track = true;
71 
78  private ‪$forceTemplateParsing = false;
79 
88  public ‪$matchAlternative = [];
89 
95  protected ‪$matchAll = false;
96 
103 
107  public ‪$ext_config_BRP = 0;
108 
112  public ‪$ext_regLinenumbers = false;
113 
117  public ‪$ext_regComments = false;
118 
124  protected ‪$simulationHiddenOrTime = false;
125 
131  public ‪$loaded = false;
132 
136  public ‪$setup = [];
137 
141  public ‪$flatSetup = [];
142 
150  public ‪$config = [];
151 
157  public ‪$constants = [];
158 
164  protected ‪$templateIncludePaths = [];
165 
171  public ‪$hierarchyInfo = [];
172 
178  protected ‪$hierarchyInfoToRoot = [];
179 
185  protected ‪$rootId;
186 
192  public ‪$rootLine;
193 
199  protected ‪$absoluteRootLine;
200 
206  protected ‪$rowSum;
207 
213  protected ‪$sitetitle = '';
214 
220  public ‪$sections;
221 
227  protected ‪$sectionsMatch;
228 
233  public ‪$clearList_const = [];
234 
240  public ‪$clearList_setup = [];
241 
245  public ‪$parserErrors = [];
246 
250  public ‪$setup_constants = [];
251 
261  protected ‪$extensionStaticsProcessed = false;
262 
268  protected ‪$processExtensionStatics = false;
269 
277  protected ‪$isDefaultTypoScriptAdded = false;
278 
287  protected ‪$processIncludesHasBeenRun = false;
288 
294 
298  protected ‪$context;
299 
303  protected ‪$packageManager;
304 
308  protected ‪$frontendController;
309 
316  {
317  $this->context = ‪$context ?? GeneralUtility::makeInstance(Context::class);
318  $this->packageManager = ‪$packageManager ?? GeneralUtility::makeInstance(PackageManager::class);
319  $this->frontendController = ‪$frontendController;
321  if ($this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false) || ‪$GLOBALS['SIM_ACCESS_TIME'] !== ‪$GLOBALS['ACCESS_TIME']) {
322  // Set the simulation flag, if simulation is detected!
323  $this->simulationHiddenOrTime = true;
324  }
325  $this->tt_track = $this->verbose = (bool)$this->context->getPropertyFromAspect('backend.user', 'isLoggedIn', false);
326  }
327 
331  public function ‪getProcessExtensionStatics()
332  {
334  }
335 
340  {
341  $this->processExtensionStatics = (bool)‪$processExtensionStatics;
342  }
343 
348  public function ‪setVerbose(‪$verbose)
349  {
350  $this->verbose = (bool)‪$verbose;
351  }
352 
356  protected function ‪initializeDatabaseQueryRestrictions()
357  {
358  $this->queryBuilderRestrictions = GeneralUtility::makeInstance(DefaultRestrictionContainer::class);
359 
360  if ($this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false)) {
361  $this->queryBuilderRestrictions->removeByType(HiddenRestriction::class);
362  }
363  }
364 
385  public function ‪getCurrentPageData(int $pageId, string $mountPointValue)
386  {
387  return GeneralUtility::makeInstance(CacheManager::class)->getCache('pagesection')->get($pageId . '_' . GeneralUtility::md5int($mountPointValue));
388  }
389 
396  public function ‪matching($cc)
397  {
398  if (is_array($cc['all'])) {
400  $matchObj = GeneralUtility::makeInstance(ConditionMatcher::class);
401  $matchObj->setRootline((array)($cc['rootLine'] ?? []));
402  ‪$sectionsMatch = [];
403  foreach ($cc['all'] as $key => $pre) {
404  if ($matchObj->match($pre)) {
405  ‪$sectionsMatch[$key] = $pre;
406  }
407  }
408  $cc['match'] = ‪$sectionsMatch;
409  }
410  return $cc;
411  }
412 
421  public function ‪start($theRootLine)
422  {
423  $cc = [];
424  // @deprecated - can be removed with TYPO3 v11.0
425  if ((bool)$this->forceTemplateParsing) {
426  $this->context->setAspect('typoscript', GeneralUtility::makeInstance(TypoScriptAspect::class, true));
427  }
428  if (is_array($theRootLine)) {
429  $constantsData = [];
430  $setupData = [];
431  $cacheIdentifier = '';
432  // Flag that indicates that the existing data in cache_pagesection
433  // could be used (this is the case if $TSFE->all is set, and the
434  // rowSum still matches). Based on this we decide if cache_pagesection
435  // needs to be updated...
436  $isCached = false;
437  $this->‪runThroughTemplates($theRootLine);
438  if ($this->‪getTypoScriptFrontendController()->all) {
439  $cc = $this->‪getTypoScriptFrontendController()->all;
440  // The two rowSums must NOT be different from each other - which they will be if start/endtime or hidden has changed!
441  if (serialize($this->rowSum) !== serialize($cc['rowSum'])) {
442  $cc = [];
443  } else {
444  // If $TSFE->all contains valid data, we don't need to update cache_pagesection (because this data was fetched from there already)
445  if (serialize($this->rootLine) === serialize($cc['rootLine'])) {
446  $isCached = true;
447  }
448  // 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)...
449  unset($cc['rootLine']);
450  }
451  }
452  // This is about getting the hash string which is used to fetch the cached TypoScript template.
453  // If there was some cached currentPageData ($cc) then that's good (it gives us the hash).
454  if (!empty($cc)) {
455  // If currentPageData was actually there, we match the result (if this wasn't done already in $TSFE->getFromCache()...)
456  if (!$cc['match']) {
457  // @todo check if this can ever be the case - otherwise remove
458  $cc = $this->‪matching($cc);
459  ksort($cc);
460  }
461  $cacheIdentifier = md5(serialize($cc));
462  } else {
463  // 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.
464  $rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
465  $result = $this->‪getCacheEntry($rowSumHash);
466  if (is_array($result)) {
467  $cc['all'] = $result;
468  $cc['rowSum'] = ‪$this->rowSum;
469  $cc = $this->‪matching($cc);
470  ksort($cc);
471  $cacheIdentifier = md5(serialize($cc));
472  }
473  }
474  if ($cacheIdentifier) {
475  // Get TypoScript setup array
476  $cachedData = $this->‪getCacheEntry($cacheIdentifier);
477  if (is_array($cachedData)) {
478  $constantsData = $cachedData['constants'];
479  $setupData = $cachedData['setup'];
480  }
481  }
482  if (!empty($setupData) && !$this->context->getPropertyFromAspect('typoscript', 'forcedTemplateParsing')) {
483  // TypoScript constants + setup are found in the cache
484  $this->setup_constants = $constantsData;
485  $this->setup = $setupData;
486  if ($this->tt_track) {
487  $this->‪getTimeTracker()->‪setTSlogMessage('Using cached TS template data');
488  }
489  } else {
490  if ($this->tt_track) {
491  $this->‪getTimeTracker()->‪setTSlogMessage('Not using any cached TS data');
492  }
493 
494  // Make configuration
495  $this->‪generateConfig();
496  // This stores the template hash thing
497  $cc = [];
498  // All sections in the template at this point is found
499  $cc['all'] = ‪$this->sections;
500  // The line of templates is collected
501  $cc['rowSum'] = ‪$this->rowSum;
502  $cc = $this->‪matching($cc);
503  ksort($cc);
504  $cacheIdentifier = md5(serialize($cc));
505  // This stores the data.
506  $this->‪setCacheEntry($cacheIdentifier, ['constants' => $this->setup_constants, 'setup' => $this->setup], 'TS_TEMPLATE');
507  if ($this->tt_track) {
508  $this->‪getTimeTracker()->‪setTSlogMessage('TS template size, serialized: ' . strlen(serialize($this->setup)) . ' bytes');
509  }
510  $rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
511  $this->‪setCacheEntry($rowSumHash, $cc['all'], 'TMPL_CONDITIONS_ALL');
512  }
513  // Add rootLine
514  $cc['rootLine'] = ‪$this->rootLine;
515  ksort($cc);
516  // Make global and save
517  $this->‪getTypoScriptFrontendController()->all = $cc;
518  // Matching must be executed for every request, so this must never be part of the pagesection cache!
519  unset($cc['match']);
520  if (!$isCached && !$this->simulationHiddenOrTime && !$this->‪getTypoScriptFrontendController()->no_cache) {
521  // Only save the data if we're not simulating by hidden/starttime/endtime
522  $mpvarHash = GeneralUtility::md5int($this->‪getTypoScriptFrontendController()->MP);
524  $pageSectionCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pagesection');
525  $pageSectionCache->set((int)$this->‪getTypoScriptFrontendController()->id . '_' . $mpvarHash, $cc, [
526  'pageId_' . (int)$this->‪getTypoScriptFrontendController()->id,
527  'mpvarHash_' . $mpvarHash
528  ]);
529  }
530  // If everything OK.
531  if ($this->rootId && $this->rootLine && $this->setup) {
532  $this->loaded = true;
533  }
534  }
535  }
536 
537  /*******************************************************************
538  *
539  * Fetching TypoScript code text for the Template Hierarchy
540  *
541  *******************************************************************/
551  public function ‪runThroughTemplates($theRootLine, $start_template_uid = 0)
552  {
553  $this->constants = [];
554  $this->config = [];
555  $this->rowSum = [];
556  $this->hierarchyInfoToRoot = [];
557  $this->absoluteRootLine = $theRootLine;
558  $this->isDefaultTypoScriptAdded = false;
559 
560  reset($this->absoluteRootLine);
561  $c = count($this->absoluteRootLine);
562  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
563  for ($a = 0; $a < $c; $a++) {
564  $where = [
565  $queryBuilder->expr()->eq(
566  'pid',
567  $queryBuilder->createNamedParameter($this->absoluteRootLine[$a]['uid'], \PDO::PARAM_INT)
568  )
569  ];
570  // If first loop AND there is set an alternative template uid, use that
571  if ($a === $c - 1 && $start_template_uid) {
572  $where[] = $queryBuilder->expr()->eq(
573  'uid',
574  $queryBuilder->createNamedParameter($start_template_uid, \PDO::PARAM_INT)
575  );
576  }
577  $queryBuilder->setRestrictions($this->queryBuilderRestrictions);
578  $queryResult = $queryBuilder
579  ->select('*')
580  ->from('sys_template')
581  ->where(...$where)
582  ->orderBy('root', 'DESC')
583  ->addOrderBy('sorting')
584  ->setMaxResults(1)
585  ->execute();
586  if ($row = $queryResult->fetch()) {
587  $this->‪versionOL($row);
588  if (is_array($row)) {
589  $this->‪processTemplate($row, 'sys_' . $row['uid'], $this->absoluteRootLine[$a]['uid'], 'sys_' . $row['uid']);
590  }
591  }
592  $this->rootLine[] = $this->absoluteRootLine[$a];
593  }
594 
595  // Hook into the default TypoScript to add custom typoscript logic
596  $hookParameters = [
597  'extensionStaticsProcessed' => &‪$this->extensionStaticsProcessed,
598  'isDefaultTypoScriptAdded' => &‪$this->isDefaultTypoScriptAdded,
599  'absoluteRootLine' => &‪$this->absoluteRootLine,
600  'rootLine' => &‪$this->rootLine,
601  'startTemplateUid' => $start_template_uid,
602  'rowSum' => &‪$this->rowSum,
603  ];
604  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing'] ?? [] as $listener) {
605  GeneralUtility::callUserFunction($listener, $hookParameters, $this);
606  }
607 
608  // Process extension static files if not done yet, but explicitly requested
609  if (!$this->extensionStaticsProcessed && $this->processExtensionStatics) {
610  $this->‪addExtensionStatics('sys_0', 'sys_0', 0);
611  }
612 
613  // Add the global default TypoScript from the TYPO3_CONF_VARS
614  $this->‪addDefaultTypoScript();
615 
616  $this->‪processIncludes();
617  }
618 
631  public function ‪processTemplate($row, $idList, $pid, $templateID = '', $templateParent = '', $includePath = '')
632  {
633  // Adding basic template record information to rowSum array
634  $this->rowSum[] = [$row['uid'] ?? null, $row['title'] ?? null, $row['tstamp'] ?? null];
635  // Processing "Clear"-flags
636  $clConst = 0;
637  $clConf = 0;
638  if (!empty($row['clear'])) {
639  $clConst = $row['clear'] & 1;
640  $clConf = $row['clear'] & 2;
641  if ($clConst) {
642  // Keep amount of items to stay in sync with $this->templateIncludePaths so processIncludes() does not break
643  foreach ($this->constants as &$constantConfiguration) {
644  $constantConfiguration = '';
645  }
646  unset($constantConfiguration);
647  $this->clearList_const = [];
648  }
649  if ($clConf) {
650  // Keep amount of items to stay in sync with $this->templateIncludePaths so processIncludes() does not break
651  foreach ($this->config as &$configConfiguration) {
652  $configConfiguration = '';
653  }
654  unset($configConfiguration);
655  $this->hierarchyInfoToRoot = [];
656  $this->clearList_setup = [];
657  }
658  }
659  // Include files (from extensions) (#1/2)
660  // NORMAL inclusion, The EXACT same code is found below the basedOn inclusion!!!
661  if (!isset($row['includeStaticAfterBasedOn']) || !$row['includeStaticAfterBasedOn']) {
662  $this->‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row);
663  }
664  // Include "Based On" sys_templates:
665  // 'basedOn' is a list of templates to include
666  if (trim($row['basedOn'] ?? '')) {
667  // Normal Operation, which is to include the "based-on" sys_templates,
668  // if they are not already included, and maintaining the sorting of the templates
669  $basedOnIds = ‪GeneralUtility::intExplode(',', $row['basedOn'], true);
670  // skip template if it's already included
671  foreach ($basedOnIds as $key => $basedOnId) {
672  if (GeneralUtility::inList($idList, 'sys_' . $basedOnId)) {
673  unset($basedOnIds[$key]);
674  }
675  }
676  if (!empty($basedOnIds)) {
677  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
678  $queryBuilder->setRestrictions($this->queryBuilderRestrictions);
679  $queryResult = $queryBuilder
680  ->select('*')
681  ->from('sys_template')
682  ->where(
683  $queryBuilder->expr()->in(
684  'uid',
685  $queryBuilder->createNamedParameter($basedOnIds, Connection::PARAM_INT_ARRAY)
686  )
687  )
688  ->execute();
689  // make it an associative array with the UID as key
690  $subTemplates = [];
691  while ($rowItem = $queryResult->fetch()) {
692  $subTemplates[(int)$rowItem['uid']] = $rowItem;
693  }
694  // Traversing list again to ensure the sorting of the templates
695  foreach ($basedOnIds as $id) {
696  if (is_array($subTemplates[$id])) {
697  $this->‪versionOL($subTemplates[$id]);
698  $this->‪processTemplate($subTemplates[$id], $idList . ',sys_' . $id, $pid, 'sys_' . $id, $templateID);
699  }
700  }
701  }
702  }
703  // Include files (from extensions) (#2/2)
704  if (!empty($row['includeStaticAfterBasedOn'])) {
705  $this->‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row);
706  }
707  // Creating hierarchy information; Used by backend analysis tools
708  $this->hierarchyInfo[] = ($this->hierarchyInfoToRoot[] = [
709  'root' => trim($row['root'] ?? ''),
710  'clConst' => $clConst,
711  'clConf' => $clConf,
712  'templateID' => $templateID,
713  'templateParent' => $templateParent,
714  'title' => $row['title'],
715  'uid' => $row['uid'],
716  'pid' => $row['pid'] ?? null,
717  'configLines' => substr_count($row['config'], LF) + 1
718  ]);
719  // Adding the content of the fields constants (Constants) and config (Setup)
720  $this->constants[] = $row['constants'];
721  $this->config[] = $row['config'];
722  $this->templateIncludePaths[] = $includePath;
723  // For backend analysis (Template Analyzer) provide the order of added constants/config template IDs
724  $this->clearList_const[] = $templateID;
725  $this->clearList_setup[] = $templateID;
726  if (trim($row['sitetitle'] ?? null)) {
727  $this->sitetitle = $row['sitetitle'];
728  }
729  // If the template record is a Rootlevel record, set the flag and clear the template rootLine (so it starts over from this point)
730  if (trim($row['root'] ?? '')) {
731  $this->rootId = $pid;
732  $this->rootLine = [];
733  }
734  }
735 
746  public function ‪updateRootlineData($fullRootLine)
747  {
748  if (!is_array($this->rootLine) || empty($this->rootLine)) {
749  return;
750  }
751 
752  $fullRootLineByUid = [];
753  foreach ($fullRootLine as $rootLineData) {
754  $fullRootLineByUid[$rootLineData['uid']] = $rootLineData;
755  }
756 
757  foreach ($this->rootLine as $level => $dataArray) {
758  $currentUid = $dataArray['uid'];
759 
760  if (!array_key_exists($currentUid, $fullRootLineByUid)) {
761  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);
762  }
763 
764  $this->rootLine[$level] = $fullRootLineByUid[$currentUid];
765  }
766  }
767 
778  public function ‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row)
779  {
780  // Call function for link rendering:
781  $_params = [
782  'idList' => &$idList,
783  'templateId' => &$templateID,
784  'pid' => &$pid,
785  'row' => &$row
786  ];
787  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'] ?? [] as $_funcRef) {
788  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
789  }
790  // If "Include before all static templates if root-flag is set" is set:
791  $staticFileMode = $row['static_file_mode'] ?? null;
792  if ($staticFileMode == 3 && strpos($templateID, 'sys_') === 0 && $row['root']) {
793  $this->‪addExtensionStatics($idList, $templateID, $pid);
794  }
795  // Static Template Files (Text files from extensions): include_static_file is a list of static files to include (from extensions)
796  if (trim($row['include_static_file'] ?? '')) {
797  $include_static_fileArr = ‪GeneralUtility::trimExplode(',', $row['include_static_file'], true);
798  // Traversing list
799  foreach ($include_static_fileArr as $ISF_file) {
800  if (strpos($ISF_file, 'EXT:') === 0) {
801  [$ISF_extKey, $ISF_localPath] = explode('/', substr($ISF_file, 4), 2);
802  if ((string)$ISF_extKey !== '' && ‪ExtensionManagementUtility::isLoaded($ISF_extKey) && (string)$ISF_localPath !== '') {
803  $ISF_localPath = rtrim($ISF_localPath, '/') . '/';
804  $ISF_filePath = ‪ExtensionManagementUtility::extPath($ISF_extKey) . $ISF_localPath;
805  if (@is_dir($ISF_filePath)) {
806  $mExtKey = str_replace('_', '', $ISF_extKey . '/' . $ISF_localPath);
807 
808  $includeStaticTxtPath = $ISF_filePath . 'include_static.txt';
809  $includeStaticTxtContents = '';
810  if (@file_exists($includeStaticTxtPath)) {
811  $includeStaticTxtContents = (string)file_get_contents($includeStaticTxtPath);
812  $includeStaticTxtContents = implode(',', array_unique(‪GeneralUtility::intExplode(',', $includeStaticTxtContents)));
813  }
814 
815  $includeStaticFileTxtPath = $ISF_filePath . 'include_static_file.txt';
816  $includeStaticFileTxtContents = '';
817  if (@file_exists($includeStaticFileTxtPath)) {
818  $includeStaticFileTxtContents = (string)file_get_contents($includeStaticFileTxtPath);
819  $includeStaticFileTxtContents = implode(',', array_unique(‪GeneralUtility::trimExplode(',', $includeStaticFileTxtContents)));
820  }
821 
822  $subrow = [
823  'constants' => $this->‪getTypoScriptSourceFileContent($ISF_filePath, 'constants'),
824  'config' => $this->‪getTypoScriptSourceFileContent($ISF_filePath, 'setup'),
825  'include_static' => $includeStaticTxtContents,
826  'include_static_file' => $includeStaticFileTxtContents,
827  'title' => $ISF_file,
828  'uid' => $mExtKey
829  ];
830  $subrow = $this->‪prependStaticExtra($subrow);
831  $this->‪processTemplate($subrow, $idList . ',ext_' . $mExtKey, $pid, 'ext_' . $mExtKey, $templateID, $ISF_filePath);
832  }
833  }
834  }
835  }
836  }
837  // If "Default (include before if root flag is set)" is set OR
838  // "Always include before this template record" AND root-flag are set
839  if ($staticFileMode == 1 || $staticFileMode == 0 && strpos($templateID, 'sys_') === 0 && $row['root']) {
840  $this->‪addExtensionStatics($idList, $templateID, $pid);
841  }
842  // Include Static Template Records after all other TypoScript has been included.
843  $_params = [
844  'idList' => &$idList,
845  'templateId' => &$templateID,
846  'pid' => &$pid,
847  'row' => &$row
848  ];
849  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'] ?? [] as $_funcRef) {
850  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
851  }
852  }
853 
862  protected function ‪getTypoScriptSourceFileContent($filePath, $baseName)
863  {
864  $extensions = ['.typoscript', '.ts', '.txt'];
865  foreach ($extensions as $extension) {
866  $fileName = $filePath . $baseName . $extension;
867  if (@file_exists($fileName)) {
868  return file_get_contents($fileName);
869  }
870  }
871  return '';
872  }
873 
883  public function ‪addExtensionStatics($idList, $templateID, $pid)
884  {
885  $this->extensionStaticsProcessed = true;
886 
887  foreach ($this->packageManager->getActivePackages() as $package) {
888  $extKey = $package->getPackageKey();
889  $packagePath = $package->getPackagePath();
890  $filesToCheck = [
891  'ext_typoscript_constants.txt',
892  'ext_typoscript_constants.typoscript',
893  'ext_typoscript_setup.txt',
894  'ext_typoscript_setup.typoscript',
895  ];
896  $files = [];
897  $hasExtensionStatics = false;
898  foreach ($filesToCheck as $file) {
899  $path = $packagePath . $file;
900  if (@file_exists($path)) {
901  $files[$file] = $path;
902  $hasExtensionStatics = true;
903  } else {
904  $files[$file] = null;
905  }
906  }
907 
908  if ($hasExtensionStatics) {
909  $mExtKey = str_replace('_', '', $extKey);
910  ‪$constants = '';
911  ‪$config = '';
912 
913  if (!empty($files['ext_typoscript_constants.typoscript'])) {
914  ‪$constants = @file_get_contents($files['ext_typoscript_constants.typoscript']);
915  } elseif (!empty($files['ext_typoscript_constants.txt'])) {
916  ‪$constants = @file_get_contents($files['ext_typoscript_constants.txt']);
917  }
918 
919  if (!empty($files['ext_typoscript_setup.typoscript'])) {
920  ‪$config = @file_get_contents($files['ext_typoscript_setup.typoscript']);
921  } elseif (!empty($files['ext_typoscript_setup.txt'])) {
922  ‪$config = @file_get_contents($files['ext_typoscript_setup.txt']);
923  }
924 
925  $this->‪processTemplate(
926  $this->‪prependStaticExtra([
927  'constants' => ‪$constants,
928  'config' => ‪$config,
929  'title' => $extKey,
930  'uid' => $mExtKey
931  ]),
932  $idList . ',ext_' . $mExtKey,
933  $pid,
934  'ext_' . $mExtKey,
935  $templateID,
936  $packagePath
937  );
938  }
939  }
940  }
941 
951  protected function ‪prependStaticExtra($subrow)
952  {
953  // the identifier can be "43" if coming from "static template" extension or a path like "cssstyledcontent/static/"
954  $identifier = $subrow['uid'];
955  $subrow['config'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup.'][$identifier] ?? null;
956  $subrow['constants'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants.'][$identifier] ?? null;
957  // 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
958  if (in_array($identifier, ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['contentRenderingTemplates'], true)) {
959  $subrow['config'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup.']['defaultContentRendering'];
960  $subrow['constants'] .= ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants.']['defaultContentRendering'];
961  }
962  return $subrow;
963  }
964 
970  protected function ‪versionOL(&$row)
971  {
972  if ($this->context->getPropertyFromAspect('workspace', 'isOffline')) {
973  $pageRepository = GeneralUtility::makeInstance(PageRepository::class, $this->context);
974  $pageRepository->versionOL('sys_template', $row);
975  }
976  }
977 
978  /*******************************************************************
979  *
980  * Parsing TypoScript code text from Template Records into PHP array
981  *
982  *******************************************************************/
990  public function ‪generateConfig()
991  {
992  // Add default TS for all code types
993  $this->‪addDefaultTypoScript();
994 
995  // Parse the TypoScript code text for include-instructions!
996  $this->‪processIncludes();
997  // These vars are also set later on...
998  $this->setup['sitetitle'] = ‪$this->sitetitle;
999  // ****************************
1000  // Parse TypoScript Constants
1001  // ****************************
1002  // Initialize parser and match-condition classes:
1004  ‪$constants = GeneralUtility::makeInstance(TypoScriptParser::class);
1005  ‪$constants->breakPointLN = (int)$this->ext_constants_BRP;
1007  $matchObj = GeneralUtility::makeInstance(ConditionMatcher::class);
1008  $matchObj->setSimulateMatchConditions($this->matchAlternative);
1009  $matchObj->setSimulateMatchResult((bool)$this->matchAll);
1010  // Traverse constants text fields and parse them
1011  foreach ($this->constants as $str) {
1012  ‪$constants->parse($str, $matchObj);
1013  }
1014  // Read out parse errors if any
1015  $this->parserErrors['constants'] = ‪$constants->errors;
1016  // 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)
1017  $this->flatSetup = ‪ArrayUtility::flatten(‪$constants->setup, '', true);
1018  // ***********************************************
1019  // Parse TypoScript Setup (here called "config")
1020  // ***********************************************
1021  // Initialize parser and match-condition classes:
1023  ‪$config = GeneralUtility::makeInstance(TypoScriptParser::class);
1024  ‪$config->breakPointLN = (int)$this->ext_config_BRP;
1025  ‪$config->regLinenumbers = ‪$this->ext_regLinenumbers;
1026  ‪$config->regComments = ‪$this->ext_regComments;
1027  ‪$config->setup = ‪$this->setup;
1028  // Transfer information about conditions found in "Constants" and which of them returned TRUE.
1029  ‪$config->sections = ‪$constants->sections;
1030  ‪$config->sectionsMatch = ‪$constants->sectionsMatch;
1031  // Traverse setup text fields and concatenate them into one, single string separated by a [GLOBAL] condition
1032  $all = '';
1033  foreach ($this->config as $str) {
1034  $all .= '
1035 [GLOBAL]
1036 ' . $str;
1037  }
1038  // Substitute constants in the Setup code:
1039  if ($this->tt_track) {
1040  $this->‪getTimeTracker()->‪push('Substitute Constants (' . count($this->flatSetup) . ')');
1041  }
1042  $all = $this->‪substituteConstants($all);
1043  if ($this->tt_track) {
1044  $this->‪getTimeTracker()->‪pull();
1045  }
1046 
1047  // Searching for possible unsubstituted constants left (only for information)
1048  if ($this->verbose) {
1049  if (preg_match_all('/\\{\\$.[^}]*\\}/', $all, $constantList) > 0) {
1050  if ($this->tt_track) {
1051  $this->‪getTimeTracker()->‪setTSlogMessage(implode(', ', $constantList[0]) . ': Constants may remain un-substituted!!', 2);
1052  }
1053  }
1054  }
1055 
1056  // Logging the textual size of the TypoScript Setup field text with all constants substituted:
1057  if ($this->tt_track) {
1058  $this->‪getTimeTracker()->‪setTSlogMessage('TypoScript template size as textfile: ' . strlen($all) . ' bytes');
1059  }
1060  // Finally parse the Setup field TypoScript code (where constants are now substituted)
1061  ‪$config->parse($all, $matchObj);
1062  // Read out parse errors if any
1063  $this->parserErrors['config'] = ‪$config->errors;
1064  // Transfer the TypoScript array from the parser object to the internal $this->setup array:
1065  $this->setup = ‪$config->setup;
1066  // Do the same for the constants
1067  $this->setup_constants = ‪$constants->setup;
1068  // ****************************************************************
1069  // Final processing of the $this->setup TypoScript Template array
1070  // Basically: This is unsetting/setting of certain reserved keys.
1071  // ****************************************************************
1072  // 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!
1073  unset($this->setup['sitetitle']);
1074  unset($this->setup['sitetitle.']);
1075  $this->setup['sitetitle'] = ‪$this->sitetitle;
1076  // Unsetting some vars...
1077  unset($this->setup['types.']);
1078  unset($this->setup['types']);
1079  if (is_array($this->setup)) {
1080  foreach ($this->setup as $key => $value) {
1081  if ($value === 'PAGE') {
1082  // Set the typeNum of the current page object:
1083  if (isset($this->setup[$key . '.']['typeNum'])) {
1084  $typeNum = $this->setup[$key . '.']['typeNum'];
1085  $this->setup['types.'][$typeNum] = $key;
1086  } elseif (!isset($this->setup['types.'][0]) || !$this->setup['types.'][0]) {
1087  $this->setup['types.'][0] = $key;
1088  }
1089  }
1090  }
1091  }
1092  unset($this->setup['temp.']);
1093  unset(‪$constants);
1094  // Storing the conditions found/matched information:
1095  $this->sections = ‪$config->sections;
1096  $this->sectionsMatch = ‪$config->sectionsMatch;
1097  }
1098 
1107  protected function ‪processIncludes()
1108  {
1109  if ($this->processIncludesHasBeenRun) {
1110  return;
1111  }
1112 
1114  $files = [];
1115  foreach ($this->constants as &$value) {
1116  $includeData = ‪TypoScriptParser::checkIncludeLines($value, 1, true, array_shift($paths));
1117  $files = array_merge($files, $includeData['files']);
1118  $value = $includeData['typoscript'];
1119  }
1120  unset($value);
1122  foreach ($this->config as &$value) {
1123  $includeData = ‪TypoScriptParser::checkIncludeLines($value, 1, true, array_shift($paths));
1124  $files = array_merge($files, $includeData['files']);
1125  $value = $includeData['typoscript'];
1126  }
1127  unset($value);
1128 
1129  if (!empty($files)) {
1130  $files = array_unique($files);
1131  foreach ($files as $file) {
1132  $this->rowSum[] = [$file, filemtime($file)];
1133  }
1134  }
1135 
1136  $this->processIncludesHasBeenRun = true;
1137  }
1138 
1146  protected function ‪substituteConstants($all)
1147  {
1148  if ($this->tt_track) {
1149  $this->‪getTimeTracker()->‪setTSlogMessage('Constants to substitute: ' . count($this->flatSetup));
1150  }
1151  $noChange = false;
1152  // Recursive substitution of constants (up to 10 nested levels)
1153  for ($i = 0; $i < 10 && !$noChange; $i++) {
1154  $old_all = $all;
1155  $all = preg_replace_callback('/\\{\\$(.[^}]*)\\}/', [$this, 'substituteConstantsCallBack'], $all) ?? '';
1156  if ($old_all == $all) {
1157  $noChange = true;
1158  }
1159  }
1160  return $all;
1161  }
1162 
1171  public function ‪substituteConstantsCallBack($matches)
1172  {
1173  // Replace {$CONST} if found in $this->flatSetup, else leave unchanged
1174  return isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? $this->flatSetup[$matches[1]] : $matches[0];
1175  }
1176 
1177  /*******************************************************************
1178  *
1179  * Various API functions, used from elsewhere in the frontend classes
1180  *
1181  *******************************************************************/
1182 
1189  public function ‪getRootlineLevel($list)
1190  {
1191  $idx = 0;
1192  foreach ($this->rootLine as $page) {
1193  if (GeneralUtility::inList($list, $page['uid'])) {
1194  return $idx;
1195  }
1196  $idx++;
1197  }
1198  return false;
1199  }
1200 
1206  public function ‪getRootId(): int
1207  {
1208  return (int)‪$this->rootId;
1209  }
1210 
1211  /*******************************************************************
1212  *
1213  * Functions for creating links
1214  *
1215  *******************************************************************/
1223  protected function ‪addDefaultTypoScript()
1224  {
1225  // Add default TS for all code types, if not done already
1226  if (!$this->isDefaultTypoScriptAdded) {
1227  $rootTemplateId = $this->hierarchyInfo[count($this->hierarchyInfo) - 1]['templateID'] ?? null;
1228 
1229  // adding constants from site settings
1230  $siteConstants = '';
1231  if ($this->‪getTypoScriptFrontendController() instanceof TypoScriptFrontendController) {
1232  $site = $this->‪getTypoScriptFrontendController()->‪getSite();
1233  } else {
1234  $currentPage = end($this->absoluteRootLine);
1235  try {
1236  $site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId((int)($currentPage['uid'] ?? 0));
1237  } catch (SiteNotFoundException $exception) {
1238  $site = null;
1239  }
1240  }
1241  if ($site instanceof Site) {
1242  $siteSettings = $site->getConfiguration()['settings'] ?? [];
1243  if (!empty($siteSettings)) {
1244  $siteSettings = ‪ArrayUtility::flattenPlain($siteSettings);
1245  foreach ($siteSettings as $k => $v) {
1246  $siteConstants .= $k . ' = ' . $v . LF;
1247  }
1248  }
1249  }
1250 
1251  if ($siteConstants !== '') {
1252  // the count of elements in ->constants, ->config and ->templateIncludePaths have to be in sync
1253  array_unshift($this->constants, $siteConstants);
1254  array_unshift($this->config, '');
1255  array_unshift($this->templateIncludePaths, '');
1256  // prepare a proper entry to hierachyInfo (used by TemplateAnalyzer in BE)
1257  $defaultTemplateInfo = [
1258  'root' => '',
1259  'clConst' => '',
1260  'clConf' => '',
1261  'templateID' => '_siteConstants_',
1262  'templateParent' => $rootTemplateId,
1263  'title' => 'Site settings',
1264  'uid' => '_siteConstants_',
1265  'pid' => '',
1266  'configLines' => 0
1267  ];
1268  // push info to information arrays used in BE by TemplateTools (Analyzer)
1269  array_unshift($this->clearList_const, $defaultTemplateInfo['uid']);
1270  array_unshift($this->clearList_setup, $defaultTemplateInfo['uid']);
1271  array_unshift($this->hierarchyInfo, $defaultTemplateInfo);
1272  }
1274  // adding default setup and constants
1275  // defaultTypoScript_setup is *very* unlikely to be empty
1276  // the count of elements in ->constants, ->config and ->templateIncludePaths have to be in sync
1277  array_unshift($this->constants, (string)‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']);
1278  array_unshift($this->config, (string)‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']);
1279  array_unshift($this->templateIncludePaths, '');
1280  // prepare a proper entry to hierachyInfo (used by TemplateAnalyzer in BE)
1281  $defaultTemplateInfo = [
1282  'root' => '',
1283  'clConst' => '',
1284  'clConf' => '',
1285  'templateID' => '_defaultTypoScript_',
1286  'templateParent' => $rootTemplateId,
1287  'title' => 'SYS:TYPO3_CONF_VARS:FE:defaultTypoScript',
1288  'uid' => '_defaultTypoScript_',
1289  'pid' => '',
1290  'configLines' => substr_count((string)‪$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'], LF) + 1
1291  ];
1292  // push info to information arrays used in BE by TemplateTools (Analyzer)
1293  array_unshift($this->clearList_const, $defaultTemplateInfo['uid']);
1294  array_unshift($this->clearList_setup, $defaultTemplateInfo['uid']);
1295  array_unshift($this->hierarchyInfo, $defaultTemplateInfo);
1296 
1297  $this->isDefaultTypoScriptAdded = true;
1298  }
1299  }
1300 
1304  protected function ‪getTypoScriptFrontendController()
1305  {
1306  return $this->frontendController ?? ‪$GLOBALS['TSFE'] ?? null;
1307  }
1308 
1312  protected function ‪getTimeTracker()
1313  {
1314  return GeneralUtility::makeInstance(TimeTracker::class);
1315  }
1316 
1324  protected function ‪getCacheEntry($identifier)
1325  {
1326  return GeneralUtility::makeInstance(CacheManager::class)->getCache('hash')->get($identifier);
1327  }
1328 
1336  protected function ‪setCacheEntry($identifier, $data, $tag)
1337  {
1338  GeneralUtility::makeInstance(CacheManager::class)->getCache('hash')->set($identifier, $data, ['ident_' . $tag], 0);
1339  }
1340 }
‪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:1068
‪TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction
Definition: HiddenRestriction.php:27
‪TYPO3\CMS\Core\TypoScript\TemplateService\$constants
‪array $constants
Definition: TemplateService.php:140
‪TYPO3\CMS\Core\TypoScript\TemplateService\addDefaultTypoScript
‪addDefaultTypoScript()
Definition: TemplateService.php:1184
‪TYPO3\CMS\Core\TypoScript\TemplateService\setVerbose
‪setVerbose($verbose)
Definition: TemplateService.php:309
‪TYPO3\CMS\Core\TypoScript\TemplateService\substituteConstants
‪string substituteConstants($all)
Definition: TemplateService.php:1107
‪TYPO3\CMS\Core\TypoScript\TemplateService\$clearList_setup
‪array $clearList_setup
Definition: TemplateService.php:211
‪TYPO3\CMS\Core\TypoScript\TemplateService\$context
‪Context $context
Definition: TemplateService.php:261
‪TYPO3\CMS\Core\TypoScript\TemplateService\substituteConstantsCallBack
‪string substituteConstantsCallBack($matches)
Definition: TemplateService.php:1132
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
Definition: TypoScriptParser.php:37
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getSite
‪getSite()
Definition: TypoScriptFrontendController.php:3971
‪TYPO3\CMS\Core\TypoScript\TemplateService\$flatSetup
‪array $flatSetup
Definition: TemplateService.php:126
‪TYPO3\CMS\Core\TypoScript\TemplateService\prependStaticExtra
‪array prependStaticExtra($subrow)
Definition: TemplateService.php:912
‪TYPO3\CMS\Core\TypoScript\TemplateService\$deprecatedPublicProperties
‪string[] $deprecatedPublicProperties
Definition: TemplateService.php:50
‪TYPO3\CMS\Core\TypoScript\TemplateService\$parserErrors
‪array $parserErrors
Definition: TemplateService.php:215
‪TYPO3\CMS\Core\Exception\SiteNotFoundException
Definition: SiteNotFoundException.php:26
‪TYPO3\CMS\Core\Site\SiteFinder
Definition: SiteFinder.php:31
‪TYPO3\CMS\Core\TypoScript\TemplateService\$tt_track
‪bool $tt_track
Definition: TemplateService.php:66
‪TYPO3\CMS\Core\TypoScript\TemplateService\$sitetitle
‪string $sitetitle
Definition: TemplateService.php:188
‪TYPO3\CMS\Core\TypoScript\TemplateService\$hierarchyInfo
‪array $hierarchyInfo
Definition: TemplateService.php:152
‪TYPO3\CMS\Core\TypoScript\TemplateService\$processExtensionStatics
‪bool $processExtensionStatics
Definition: TemplateService.php:235
‪TYPO3\CMS\Core\TypoScript\TemplateService\$matchAll
‪bool $matchAll
Definition: TemplateService.php:88
‪TYPO3\CMS\Core\TypoScript\TemplateService\$packageManager
‪PackageManager $packageManager
Definition: TemplateService.php:265
‪TYPO3\CMS\Core\TypoScript\TemplateService\getCacheEntry
‪mixed getCacheEntry($identifier)
Definition: TemplateService.php:1285
‪TYPO3\CMS\Core\TypoScript\TemplateService\getProcessExtensionStatics
‪bool getProcessExtensionStatics()
Definition: TemplateService.php:292
‪TYPO3\CMS\Core\TypoScript\TemplateService\$forceTemplateParsing
‪bool $forceTemplateParsing
Definition: TemplateService.php:73
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Core\TypoScript\TemplateService\$setup_constants
‪array $setup_constants
Definition: TemplateService.php:219
‪TYPO3\CMS\Core\TypoScript\TemplateService\runThroughTemplates
‪runThroughTemplates($theRootLine, $start_template_uid=0)
Definition: TemplateService.php:512
‪TYPO3\CMS\Core\TypoScript\TemplateService\__construct
‪__construct(Context $context=null, PackageManager $packageManager=null, TypoScriptFrontendController $frontendController=null)
Definition: TemplateService.php:276
‪TYPO3\CMS\Core\TypoScript\TemplateService\versionOL
‪versionOL(&$row)
Definition: TemplateService.php:931
‪TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources
‪includeStaticTypoScriptSources($idList, $templateID, $pid, $row)
Definition: TemplateService.php:739
‪TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptSourceFileContent
‪string getTypoScriptSourceFileContent($filePath, $baseName)
Definition: TemplateService.php:823
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:40
‪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:592
‪TYPO3\CMS\Core\TypoScript
Definition: ExtendedTemplateService.php:16
‪TYPO3\CMS\Core\TypoScript\TemplateService\$simulationHiddenOrTime
‪bool $simulationHiddenOrTime
Definition: TemplateService.php:112
‪TYPO3\CMS\Core\TypoScript\TemplateService\setCacheEntry
‪setCacheEntry($identifier, $data, $tag)
Definition: TemplateService.php:1297
‪TYPO3\CMS\Core\TypoScript\TemplateService\$frontendController
‪TypoScriptFrontendController null $frontendController
Definition: TemplateService.php:269
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage
‪setTSlogMessage($content, $num=0)
Definition: TimeTracker.php:215
‪TYPO3\CMS\Core\TypoScript\TemplateService\$hierarchyInfoToRoot
‪array $hierarchyInfoToRoot
Definition: TemplateService.php:158
‪TYPO3\CMS\Core\TypoScript\TemplateService\$isDefaultTypoScriptAdded
‪bool $isDefaultTypoScriptAdded
Definition: TemplateService.php:243
‪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:252
‪TYPO3\CMS\Core\Context\TypoScriptAspect
Definition: TypoScriptAspect.php:29
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_regComments
‪bool $ext_regComments
Definition: TemplateService.php:106
‪TYPO3\CMS\Core\TypoScript\TemplateService\addExtensionStatics
‪addExtensionStatics($idList, $templateID, $pid)
Definition: TemplateService.php:844
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_regLinenumbers
‪bool $ext_regLinenumbers
Definition: TemplateService.php:102
‪TYPO3\CMS\Core\TypoScript\TemplateService\getRootId
‪int getRootId()
Definition: TemplateService.php:1167
‪TYPO3\CMS\Core\TypoScript\TemplateService\matching
‪array matching($cc)
Definition: TemplateService.php:357
‪TYPO3\CMS\Core\TypoScript\TemplateService\$matchAlternative
‪array $matchAlternative
Definition: TemplateService.php:82
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser\checkIncludeLines
‪static string array checkIncludeLines($string, $cycle_counter=1, $returnFiles=false, $parentFilenameOrPath='')
Definition: TypoScriptParser.php:792
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\pull
‪pull($content='')
Definition: TimeTracker.php:195
‪TYPO3\CMS\Core\TypoScript\TemplateService\$rowSum
‪array $rowSum
Definition: TemplateService.php:182
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:35
‪TYPO3\CMS\Core\TypoScript\TemplateService\getCurrentPageData
‪array getCurrentPageData(int $pageId, string $mountPointValue)
Definition: TemplateService.php:346
‪TYPO3\CMS\Core\TypoScript\TemplateService\initializeDatabaseQueryRestrictions
‪initializeDatabaseQueryRestrictions()
Definition: TemplateService.php:317
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_config_BRP
‪int $ext_config_BRP
Definition: TemplateService.php:98
‪TYPO3\CMS\Core\TypoScript\TemplateService\$config
‪array $config
Definition: TemplateService.php:134
‪TYPO3\CMS\Core\TypoScript\TemplateService\$extensionStaticsProcessed
‪bool $extensionStaticsProcessed
Definition: TemplateService.php:229
‪TYPO3\CMS\Core\TypoScript\TemplateService\$templateIncludePaths
‪array $templateIncludePaths
Definition: TemplateService.php:146
‪TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
Definition: ConditionMatcher.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Core\TypoScript\TemplateService\$setup
‪array $setup
Definition: TemplateService.php:122
‪TYPO3\CMS\Core\TypoScript\TemplateService\updateRootlineData
‪updateRootlineData($fullRootLine)
Definition: TemplateService.php:707
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Core\TypoScript\TemplateService\$sectionsMatch
‪array $sectionsMatch
Definition: TemplateService.php:200
‪TYPO3\CMS\Core\TypoScript\TemplateService\setProcessExtensionStatics
‪setProcessExtensionStatics($processExtensionStatics)
Definition: TemplateService.php:300
‪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:98
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController
‪TypoScriptFrontendController getTypoScriptFrontendController()
Definition: TemplateService.php:1265
‪TYPO3\CMS\Core\TypoScript\TemplateService\$clearList_const
‪string[] $clearList_const
Definition: TemplateService.php:205
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:988
‪TYPO3\CMS\Core\TypoScript\TemplateService\$loaded
‪bool $loaded
Definition: TemplateService.php:118
‪TYPO3\CMS\Core\TypoScript\TemplateService\$rootLine
‪array $rootLine
Definition: TemplateService.php:170
‪TYPO3\CMS\Core\TypoScript\TemplateService\$sections
‪array null $sections
Definition: TemplateService.php:194
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath
‪static string extPath($key, $script='')
Definition: ExtensionManagementUtility.php:127
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait
Definition: PublicPropertyDeprecationTrait.php:68
‪TYPO3\CMS\Core\TypoScript\TemplateService\$ext_constants_BRP
‪int $ext_constants_BRP
Definition: TemplateService.php:94
‪TYPO3\CMS\Core\TypoScript\TemplateService\$absoluteRootLine
‪array $absoluteRootLine
Definition: TemplateService.php:176
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:52
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\TypoScript\TemplateService\$verbose
‪bool $verbose
Definition: TemplateService.php:60
‪TYPO3\CMS\Core\TypoScript\TemplateService\$rootId
‪int $rootId
Definition: TemplateService.php:164
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\TypoScript\TemplateService\getRootlineLevel
‪int getRootlineLevel($list)
Definition: TemplateService.php:1150
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key)
Definition: ExtensionManagementUtility.php:114
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:30
‪TYPO3\CMS\Core\TypoScript\TemplateService\start
‪start($theRootLine)
Definition: TemplateService.php:382
‪TYPO3\CMS\Core\TypoScript\TemplateService\$queryBuilderRestrictions
‪AbstractRestrictionContainer $queryBuilderRestrictions
Definition: TemplateService.php:257
‪TYPO3\CMS\Core\TypoScript\TemplateService\getTimeTracker
‪TimeTracker getTimeTracker()
Definition: TemplateService.php:1273
‪TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer
Definition: DefaultRestrictionContainer.php:24
‪TYPO3\CMS\Core\TypoScript\TemplateService\generateConfig
‪generateConfig()
Definition: TemplateService.php:951
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\push
‪push($tslabel, $value='')
Definition: TimeTracker.php:168