YamlSource
class YamlSource (View source)
Configuration source based on YAML files
Properties
protected bool | $usePhpYamlExtension | Will be set if the PHP YAML Extension is installed. |
Methods
No description
Checks for the specified configuration file and returns true if it exists.
Loads the specified configuration file and returns its content as an array. If the file does not exist or could not be loaded, an empty array is returned
No description
Loads the file with the given path and merge it's contents into the configuration array.
Save the specified configuration array to the given file in YAML format.
Read the header part from the given file. That means, every line until the first non comment line is found.
Details
__construct()
No description
bool
has(string $pathAndFilename, bool $allowSplitSource = false)
Checks for the specified configuration file and returns true if it exists.
array
load(string $pathAndFilename, bool $allowSplitSource = false)
Loads the specified configuration file and returns its content as an array. If the file does not exist or could not be loaded, an empty array is returned
protected
detectFilesWithWrongExtension(string $pathAndFilename, bool $allowSplitSource = false)
No description
protected array
mergeFileContent(string $pathAndFilename, array $configuration)
Loads the file with the given path and merge it's contents into the configuration array.
void
save(string $pathAndFilename, array $configuration)
Save the specified configuration array to the given file in YAML format.
protected string
getHeaderFromFile(string $pathAndFilename)
Read the header part from the given file. That means, every line until the first non comment line is found.