Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Gunnar Wrobel (wrobel@pardus.de)
示例#1
0
 /**
  * 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));
 }
示例#2
0
 /**
  * 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);
 }