Components_Helper_DocsOrigin::fetchDocuments PHP Method

fetchDocuments() public method

Fetch the remote documents.
public fetchDocuments ( Components_Output $output ) : null
$output Components_Output The output handler.
return null
    public function fetchDocuments(Components_Output $output)
    {
        foreach ($this->_parse() as $local => $remote) {
            $this->_fetchDocument($remote, $local, $output);
        }
    }

Usage Example

Ejemplo n.º 1
0
 public function run()
 {
     $docs_origin = $this->_config->getComponent()->getDocumentOrigin();
     if ($docs_origin === null) {
         $this->_output->fail('The component does not offer a DOCS_ORIGIN file with instructions what should be fetched!');
         return;
     } else {
         $this->_output->info(sprintf('Reading instructions from %s', $docs_origin[0]));
         $options = $this->_config->getOptions();
         $helper = new Components_Helper_DocsOrigin($docs_origin, $this->_client);
         if (empty($options['pretend'])) {
             $helper->fetchDocuments($this->_output);
         } else {
             foreach ($helper->getDocuments() as $remote => $local) {
                 $this->_output->info(sprintf('Would fetch remote %s into %s!', $remote, $docs_origin[1] . '/' . $local));
             }
         }
     }
 }