Components_Helper_DocsOrigin::_fetchDocument PHP Method

_fetchDocument() public method

Fetch the given remote document into a local target path.
public _fetchDocument ( string $remote, string $local, Components_Output $output ) : null
$remote string The remote URI.
$local string The local target path.
$output Components_Output The output handler.
return null
    public function _fetchDocument($remote, $local, Components_Output $output)
    {
        $this->_client->{'request.timeout'} = 60;
        $content = stream_get_contents($this->_client->get($remote)->getStream());
        $content = preg_replace('#^(\\.\\. _`([^`]*)`: )((?!http://).*)#m', '\\1\\2', $content);
        file_put_contents($this->_docs_origin[1] . '/' . $local, $content);
        $output->ok(sprintf('Fetched remote %s into %s!', $remote, $this->_docs_origin[1] . '/' . $local));
    }