Gregwar\RST\Parser::includeFiles PHP Method

includeFiles() public method

Include all files described in $document and returns the new string of the given document with includes processed
public includeFiles ( $document )
    public function includeFiles($document)
    {
        $environment = $this->getEnvironment();
        $parser = $this;
        return preg_replace_callback('/^\\.\\. include:: (.+)$/m', function ($match) use($parser, $environment) {
            $path = $environment->absoluteRelativePath($match[1]);
            if ($parser->includeFileAllowed($path)) {
                return $parser->includeFiles(file_get_contents($path));
            } else {
                return '';
            }
        }, $document);
    }