Neos\Flow\Configuration\Source\YamlSource::getHeaderFromFile PHP Метод

getHeaderFromFile() защищенный Метод

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
Результат string The header of the given YAML file
    protected function getHeaderFromFile($pathAndFilename)
    {
        $header = '';
        $fileHandle = fopen($pathAndFilename, 'r');
        while ($line = fgets($fileHandle)) {
            if (preg_match('/^#/', $line)) {
                $header .= $line;
            } else {
                break;
            }
        }
        fclose($fileHandle);
        return $header;
    }