‪TYPO3CMS  10.4
LayoutController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ResponseInterface;
21 use Psr\Http\Message\ServerRequestInterface;
30 
39 {
44 
45  public function ‪__construct(
47  ) {
48  $this->silentConfigurationUpgradeService = ‪$silentConfigurationUpgradeService;
49  }
50 
58  public function ‪initAction(ServerRequestInterface $request): ResponseInterface
59  {
60  $bust = ‪$GLOBALS['EXEC_TIME'];
61  if (!‪Environment::getContext()->isDevelopment()) {
62  $bust = GeneralUtility::hmac((string)(new ‪Typo3Version()) . ‪Environment::getProjectPath());
63  }
64  $view = $this->‪initializeStandaloneView($request, 'Layout/Init.html');
65  $view->assignMultiple([
66  // time is used as cache bust for js and css resources
67  'bust' => $bust,
68  'siteName' => ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
69  ]);
70  return new HtmlResponse(
71  $view->render(),
72  200,
73  [
74  'Cache-Control' => 'no-cache, must-revalidate',
75  'Pragma' => 'no-cache'
76  ]
77  );
78  }
79 
88  public function ‪mainLayoutAction(ServerRequestInterface $request): ResponseInterface
89  {
90  $view = $this->‪initializeStandaloneView($request, 'Layout/MainLayout.html');
91  return new JsonResponse([
92  'success' => true,
93  'html' => $view->render(),
94  ]);
95  }
96 
102  public function ‪executeSilentConfigurationUpdateAction(): ResponseInterface
103  {
104  $success = true;
105  try {
106  $this->silentConfigurationUpgradeService->execute();
107  } catch (ConfigurationChangedException $e) {
108  $success = false;
109  }
110  return new JsonResponse([
111  'success' => $success,
112  ]);
113  }
114 
123  public function ‪executeSilentExtensionConfigurationSynchronizationAction(): ResponseInterface
124  {
125  $extensionConfiguration = new ExtensionConfiguration();
126  $extensionConfiguration->synchronizeExtConfTemplateWithLocalConfigurationOfAllExtensions();
127  return new JsonResponse([
128  'success' => true,
129  ]);
130  }
131 }
‪TYPO3\CMS\Install\Controller\LayoutController\initAction
‪ResponseInterface initAction(ServerRequestInterface $request)
Definition: LayoutController.php:57
‪TYPO3\CMS\Install\Controller\AbstractController\initializeStandaloneView
‪StandaloneView initializeStandaloneView(ServerRequestInterface $request, string $templatePath)
Definition: AbstractController.php:40
‪TYPO3\CMS\Install\Service\Exception\ConfigurationChangedException
Definition: ConfigurationChangedException.php:26
‪TYPO3\CMS\Core\Information\Typo3Version
Definition: Typo3Version.php:21
‪TYPO3\CMS\Core\Configuration\ExtensionConfiguration
Definition: ExtensionConfiguration.php:45
‪TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService
Definition: SilentConfigurationUpgradeService.php:44
‪TYPO3\CMS\Install\Controller\LayoutController\$silentConfigurationUpgradeService
‪SilentConfigurationUpgradeService $silentConfigurationUpgradeService
Definition: LayoutController.php:42
‪TYPO3\CMS\Install\Controller\LayoutController\__construct
‪__construct(SilentConfigurationUpgradeService $silentConfigurationUpgradeService)
Definition: LayoutController.php:44
‪TYPO3\CMS\Core\Core\Environment\getContext
‪static ApplicationContext getContext()
Definition: Environment.php:133
‪TYPO3\CMS\Core\Core\Environment\getProjectPath
‪static string getProjectPath()
Definition: Environment.php:169
‪TYPO3\CMS\Install\Controller\LayoutController\executeSilentConfigurationUpdateAction
‪ResponseInterface executeSilentConfigurationUpdateAction()
Definition: LayoutController.php:101
‪TYPO3\CMS\Install\Controller
Definition: AbstractController.php:18
‪TYPO3\CMS\Install\Controller\LayoutController\mainLayoutAction
‪ResponseInterface mainLayoutAction(ServerRequestInterface $request)
Definition: LayoutController.php:87
‪TYPO3\CMS\Install\Controller\LayoutController
Definition: LayoutController.php:39
‪TYPO3\CMS\Install\Controller\LayoutController\executeSilentExtensionConfigurationSynchronizationAction
‪ResponseInterface executeSilentExtensionConfigurationSynchronizationAction()
Definition: LayoutController.php:122
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:26
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Install\Controller\AbstractController
Definition: AbstractController.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Http\HtmlResponse
Definition: HtmlResponse.php:26