Ejemplo n.º 1
0
 /**
  * Executes the transformation process.
  *
  * @throws Zend_Console_Getopt_Exception
  *
  * @return void
  */
 public function execute()
 {
     // initialize timer
     $timer = microtime(true);
     // initialize transformer
     $transformer = new DocBlox_Transformer();
     $transformer->setThemesPath(DocBlox_Core_Abstract::config()->paths->themes);
     $transformer->setTarget($this->getTarget());
     $transformer->setSource($this->getSource());
     $transformer->setTemplates($this->getTemplate());
     $transformer->setParseprivate($this->getParseprivate());
     // add links to external docs
     $external_class_documentation = DocBlox_Core_Abstract::config()->getArrayFromPath('transformer/external-class-documentation');
     $external_class_documentation = !is_numeric(current(array_keys($external_class_documentation))) ? $external_class_documentation = array($external_class_documentation) : $external_class_documentation;
     /** @var DocBlox_Core_Config $doc */
     foreach ($external_class_documentation as $doc) {
         if (empty($doc)) {
             continue;
         }
         $transformer->setExternalClassDoc((string) $doc['prefix'], (string) $doc['uri']);
     }
     // start the transformation process
     if (!$this->getQuiet()) {
         echo 'Starting transformation of files (this could take a while depending upon the size of your project)' . PHP_EOL;
     }
     $transformer->execute();
     if (!$this->getQuiet()) {
         echo 'Finished transformation in ' . round(microtime(true) - $timer, 2) . ' seconds' . PHP_EOL;
     }
 }