/** * Fetch the given remote document into a local target path. * * @param string $remote The remote URI. * @param string $local The local target path. * @param Components_Output $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)); }
/** * Constructor. * * @param Horde_Cli $cli The CLI handler. * @param Components_Config $config The configuration for the current job. */ public function __construct($options = array()) { $this->output = new Components_Stub_Output_Cli(); parent::__construct($this->output, $options); }