‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard Class Reference

Public Member Functions

 __construct (protected array $existingConfiguration)
 
 process (array $modified)
 

Public Attributes

elseif(is_string($value)) return $modified
 

Protected Member Functions

array< string, protectPlaceholders(array $current, array $modified, array $steps=[]):array { foreach( $modified as $key=> $value) { $currentSteps=array_merge( $steps,[ $key]);if(is_array( $value)) { $modified[ $key]=$this-> protectPlaceholders ( $current[$key] ??[], $value, $currentSteps)
 

Protected Attributes

StringFragmentSplitter $fragmentSplitter
 

Detailed Description

A guard for protecting YAML placeholders - keeps existing, but escalates on adding new placeholders

Definition at line 26 of file YamlPlaceholderGuard.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard::__construct ( protected array  $existingConfiguration)

Member Function Documentation

◆ process()

TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard::process ( array  $modified)

◆ protectPlaceholders()

array<string, protectPlaceholders(array $current, array $modified, array $steps = []): array { foreach ($modified as $key => $value) { $currentSteps = array_merge($steps, [$key]); if (is_array($value)) { $modified[$key] = $this-> TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard::protectPlaceholders (   $current ??[ $key][],
  $value,
  $currentSteps 
)
protected

Detects placeholders that have been introduced and handles* them. (*) currently throws an exception, but could be purged or escaped as well

Parameters
array<string,mixed>‪$current
array<string,mixed>‪$modified
list<string>‪$steps configuration keys traversed so far
Returns
‪array<string, mixed> sanitized configuration (currently not used, exception thrown before)
Exceptions
YamlPlaceholderException

Referenced by TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard\process().

Member Data Documentation

◆ $fragmentSplitter

StringFragmentSplitter TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard::$fragmentSplitter
protected

Definition at line 28 of file YamlPlaceholderGuard.php.

◆ $modified

elseif (is_string( $value)) return TYPO3\CMS\Core\Configuration\Loader\YamlPlaceholderGuard::$modified