public function getMeta($file)
    {
        $content = file_get_contents($file);

        $matches = array();
        preg_match('~<!--(.*?)-->~msi', $content, $matches);

        if (empty($matches[1])) {
            return array();
        }

        $meta = json_decode(trim($matches[1]), true);

        if (!is_array($meta)) {
            return array();
        }

        $meta += array(
            'title' => '',
            'teaser' => '',
            'weight' => 0
        );

        return $meta;
    }
public function getMeta($file)
    {
        $content = file_get_contents($file);

        $matches = array();
        preg_match('~<!--(.*?)-->~msi', $content, $matches);

        if (empty($matches[1])) {
            return array();
        }

        $meta = json_decode(trim($matches[1]), true);

        if (!is_array($meta)) {
            return array();
        }

        $meta += array(
            'title' => '',
            'teaser' => '',
            'weight' => 0
        );

        return $meta;
    }
public function getMeta ( $ file ) { $ content = file_get_contents ( $ file ) ; $ matches = array ( ) ; preg_match ( '~<!--(.*?)-->~msi' , $ content , $ matches ) ; if ( empty ( $ matches [ 1 ] ) ) { return array ( ) ; } $ meta = json_decode ( trim ( $ matches [ 1 ] ) , true ) ; if ( ! is_array ( $ meta ) ) { return array ( ) ; } $ meta += array ( 'title' => '' , 'teaser' => '' , 'weight' => 0 ) ; return $ meta ; }
Extracts meta data from a help file
@param string $file
@return array
Extracts meta data from a help file