Components_Helper_DocsOrigin::_parse PHP Method

_parse() private method

Parse the instructions from the file.
private _parse ( ) : null
return null
    private function _parse()
    {
        if ($this->_documents === null) {
            $this->_documents = array();
            $rst = file_get_contents($this->_docs_origin[0]);
            if (preg_match_all('/^:`([^:]*)`_:(.*)$/m', $rst, $matches)) {
                foreach ($matches[1] as $match) {
                    if (preg_match('#^.. _' . $match . ':(.*)$#m', $rst, $url)) {
                        $this->_documents[$match] = trim($url[1]);
                    }
                }
            }
        }
        return $this->_documents;
    }