public function parse($rawData) {
        $rawData = trim($rawData);

        $start = substr($rawData, 0, 4);
        if ($start === '<!--') {
            $stop = '-->';
        } elseif (substr($start, 0, 2) === '/*') {
            $start = '/*';
            $stop = '*/';
        } else {
            return [];
        }

        $meta = trim(substr($rawData, strlen($start), strpos($rawData, $stop) - (strlen($stop) + 1)));
        try {
            $meta = Yaml::parse($meta);//$this->parsePhileFormat($meta);
            $meta = ($meta === null) ? [] : $this->convertKeys($meta);
        } catch (ParseException $e) {
            printf("Unable to parse the YAML string: %s<br>", $e->getMessage());
        }
        return $meta;
    }
public function parse($rawData) {
        $rawData = trim($rawData);

        $start = substr($rawData, 0, 4);
        if ($start === '<!--') {
            $stop = '-->';
        } elseif (substr($start, 0, 2) === '/*') {
            $start = '/*';
            $stop = '*/';
        } else {
            return [];
        }

        $meta = trim(substr($rawData, strlen($start), strpos($rawData, $stop) - (strlen($stop) + 1)));
        try {
            $meta = Yaml::parse($meta);//$this->parsePhileFormat($meta);
            $meta = ($meta === null) ? [] : $this->convertKeys($meta);
        } catch (ParseException $e) {
            printf("Unable to parse the YAML string: %s<br>", $e->getMessage());
        }
        return $meta;
    }
public function parse ( $ rawData ) { $ rawData = trim ( $ rawData ) ; $ start = substr ( $ rawData , 0 , 4 ) ; if ( $ start === '<!--' ) { $ stop = '-->' ; } elseif ( substr ( $ start , 0 , 2 ) === '/*' ) { $ start = '/*' ; $ stop = '*/' ; } else { return [ ] ; } $ meta = trim ( substr ( $ rawData , strlen ( $ start ) , strpos ( $ rawData , $ stop ) - ( strlen ( $ stop ) + 1 ) ) ) ; try { $ meta = Yaml :: parse ( $ meta ) ; //$this->parsePhileFormat($meta); $ meta = ( $ meta === null ) ? [ ] : $ this -> convertKeys ( $ meta ) ; } catch ( ParseException $ e ) { printf ( "Unable to parse the YAML string: %s<br>" , $ e -> getMessage ( ) ) ; } return $ meta ; }
parse the content and extract meta information

@param string $rawData raw page data
@return array with key/value store
parse the content and extract meta information