PHP Class Neos\Flow\Configuration\Source\YamlSource

Datei anzeigen Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$usePhpYamlExtension boolean Having this installed massively improves YAML parsing performance.

Public Methods

Method Description
__construct ( )
has ( string $pathAndFilename, boolean $allowSplitSource = false ) : boolean Checks for the specified configuration file and returns TRUE if it exists.
load ( string $pathAndFilename, boolean $allowSplitSource = false ) : array 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
save ( string $pathAndFilename, array $configuration ) : void Save the specified configuration array to the given file in YAML format.

Protected Methods

Method Description
getHeaderFromFile ( string $pathAndFilename ) : string Read the header part from the given file. That means, every line until the first non comment line is found.

Method Details

__construct() public method

public __construct ( )

getHeaderFromFile() protected method

Read the header part from the given file. That means, every line until the first non comment line is found.
protected getHeaderFromFile ( string $pathAndFilename ) : string
$pathAndFilename string
return string The header of the given YAML file

has() public method

Checks for the specified configuration file and returns TRUE if it exists.
public has ( string $pathAndFilename, boolean $allowSplitSource = false ) : boolean
$pathAndFilename string Full path and filename of the file to load, excluding the file extension (ie. ".yaml")
$allowSplitSource boolean If TRUE, the type will be used as a prefix when looking for configuration files
return boolean

load() public method

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
public load ( string $pathAndFilename, boolean $allowSplitSource = false ) : array
$pathAndFilename string Full path and filename of the file to load, excluding the file extension (ie. ".yaml")
$allowSplitSource boolean If TRUE, the type will be used as a prefix when looking for configuration files
return array

save() public method

Save the specified configuration array to the given file in YAML format.
public save ( string $pathAndFilename, array $configuration ) : void
$pathAndFilename string Full path and filename of the file to write to, excluding the dot and file extension (i.e. ".yaml")
$configuration array The configuration to save
return void

Property Details

$usePhpYamlExtension protected_oe property

Having this installed massively improves YAML parsing performance.
See also: http://pecl.php.net/package/yaml
protected bool $usePhpYamlExtension
return boolean