protected function load()
    {
        $data = file_get_contents($this->filename);
        // Ok, here comes the dirty work.
        // We take everything at the beginning of the file until the closing of the first doc comment.
        preg_match('#^(.+\*/)#sU', $data, $matches);

        if ($matches && count($matches[0])) {
            $this->head = $matches[0];
            if (preg_match(
                '#https://www.transifex.com/projects/p/(.*)/language/(.*)/#',
                $this->head,
                $match,
                PREG_OFFSET_CAPTURE
            )) {
                $this->transifexProject = $match[1][0][0];
                $this->language         = $match[2][0][0];
            }
        } else {
            $this->head = $this->getDefaultHead();
        }
        $this->langstrings = array();

        $parser = new Parser($this);
        $parser->setContent($data);
        $parser->parse();
    }
protected function load()
    {
        $data = file_get_contents($this->filename);
        // Ok, here comes the dirty work.
        // We take everything at the beginning of the file until the closing of the first doc comment.
        preg_match('#^(.+\*/)#sU', $data, $matches);

        if ($matches && count($matches[0])) {
            $this->head = $matches[0];
            if (preg_match(
                '#https://www.transifex.com/projects/p/(.*)/language/(.*)/#',
                $this->head,
                $match,
                PREG_OFFSET_CAPTURE
            )) {
                $this->transifexProject = $match[1][0][0];
                $this->language         = $match[2][0][0];
            }
        } else {
            $this->head = $this->getDefaultHead();
        }
        $this->langstrings = array();

        $parser = new Parser($this);
        $parser->setContent($data);
        $parser->parse();
    }
protected function load ( ) { $ data = file_get_contents ( $ this -> filename ) ; // Ok, here comes the dirty work. // We take everything at the beginning of the file until the closing of the first doc comment. preg_match ( '#^(.+\*/)#sU' , $ data , $ matches ) ; if ( $ matches && count ( $ matches [ 0 ] ) ) { $ this -> head = $ matches [ 0 ] ; if ( preg_match ( '#https://www.transifex.com/projects/p/(.*)/language/(.*)/#' , $ this -> head , $ match , PREG_OFFSET_CAPTURE ) ) { $ this -> transifexProject = $ match [ 1 ] [ 0 ] [ 0 ] ; $ this -> language = $ match [ 2 ] [ 0 ] [ 0 ] ; } } else { $ this -> head = $ this -> getDefaultHead ( ) ; } $ this -> langstrings = array ( ) ; $ parser = new Parser ( $ this ) ; $ parser -> setContent ( $ data ) ; $ parser -> parse ( ) ; }
Parse a language file into language strings.

@return void
Parse a language file into language strings .