YamlSource
Configuration source based on YAML files
Scope: frontend / backend
Table of Contents
Properties
Methods
- injectFilePersistenceSlot() : mixed
- load() : array<string|int, mixed>
- Loads the specified configuration files and returns its merged content as an array.
- save() : mixed
- Save the specified configuration array to the given file in YAML format.
- buildCombinedIdentifier() : string
- getHeaderFromFile() : string
- Read the header part from the given file. That means, every line until the first non comment line is found.
- loadFromFile() : array<string|int, mixed>
- Load YAML configuration from a FAL file
- loadFromFilePath() : array<string|int, mixed>
- Load YAML configuration from a local file path
Properties
$filePersistenceSlot
protected
FilePersistenceSlot
$filePersistenceSlot
Methods
injectFilePersistenceSlot()
public
injectFilePersistenceSlot(FilePersistenceSlot $filePersistenceSlot) : mixed
Parameters
- $filePersistenceSlot : FilePersistenceSlot
load()
Loads the specified configuration files and returns its merged content as an array.
public
load(array<string|int, mixed> $filesToLoad) : array<string|int, mixed>
Parameters
- $filesToLoad : array<string|int, mixed>
Return values
array<string|int, mixed>save()
Save the specified configuration array to the given file in YAML format.
public
save(File|string $fileToSave, array<string|int, mixed> $configuration) : mixed
Parameters
- $fileToSave : File|string
-
The file to write to.
- $configuration : array<string|int, mixed>
-
The configuration to save
Tags
buildCombinedIdentifier()
protected
buildCombinedIdentifier(FolderInterface $folder, string $fileName) : string
Parameters
- $folder : FolderInterface
- $fileName : string
Return values
stringgetHeaderFromFile()
Read the header part from the given file. That means, every line until the first non comment line is found.
protected
getHeaderFromFile(File|string $file) : string
Parameters
- $file : File|string
Return values
string —The header of the given YAML file
loadFromFile()
Load YAML configuration from a FAL file
protected
loadFromFile(File $file) : array<string|int, mixed>
Parameters
- $file : File
Tags
Return values
array<string|int, mixed>loadFromFilePath()
Load YAML configuration from a local file path
protected
loadFromFilePath(string $filePath) : array<string|int, mixed>
Parameters
- $filePath : string