Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add TypoScript provider for sites and sets
TYPO3 sites are enhanced to be able to operate as TypoScript templates. They act similar to sys_template records with "clear" and "root" flags set. By design a site TypoScript provider always defines a new scope (root-flag) and does not inherit from parent sites (in the rootline). That means it behaves as if the clear-flag is set in a sys_template record. This behavior is not configurable by design, as TypoScript code sharing is intended to be implemented via sharable sets (introduced in #103437). TypoScript dependencies can be included via sets dependencies. This mechanism supersedes the previous static_file_include's or manual `@import` statements (they are still fine for local includes, but should be avoided for cross-set/extensions dependencies), as sets are automatically ordered and deduplicated. Resolves: #103439 Releases: main Change-Id: I971743fc551e51d945f45335dc6ad76404c6edba Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83119 Tested-by: Benjamin Kott <benjamin.kott@outlook.com> Reviewed-by: Benjamin Franzke <ben@bnf.dev> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: core-ci <typo3@b13.com> Tested-by: Benjamin Franzke <ben@bnf.dev> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
- Loading branch information
Showing
22 changed files
with
569 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Core\Site\Entity; | ||
|
||
final readonly class SiteTypoScript | ||
{ | ||
public function __construct( | ||
public ?string $setup = null, | ||
public ?string $constants = null, | ||
) {} | ||
|
||
public static function __set_state(array $state): self | ||
{ | ||
return new self(...$state); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
typo3/sysext/core/Classes/TypoScript/IncludeTree/IncludeNode/SiteTemplateInclude.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode; | ||
|
||
/** | ||
* The main node created for TypoScript from site sets | ||
* and %configPath/sites/{constants,setup}.typoscript. | ||
* | ||
* @internal: Internal tree structure. | ||
*/ | ||
final class SiteTemplateInclude extends AbstractInclude | ||
{ | ||
protected bool $root = true; | ||
protected bool $clear = true; | ||
|
||
public function isRoot(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function isClear(): bool | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.