Exemple #1
0
 /**
  * Process a build set
  * @param object $set The build configuration set
  * @return array Returns the complete process set
  * @since 1.1.0
  */
 public function process()
 {
     $result = array();
     if (property_exists($this->set, 'processor')) {
         $this->processor += $this->pushProcessor($this->set->processor);
         $result[] = new Stack($this->processor);
     }
     foreach ($this->set->build as $entry) {
         if (is_object($entry)) {
             $subManager = new BuildManager($entry, $this->processor);
             $result = array_merge($result, $subManager->process());
             $result[] = new Stack($this->processor);
         } else {
             $find = new Finder();
             if (is_dir($entry)) {
                 $find->files()->in($entry);
             } elseif (is_file($entry)) {
                 $find->files()->depth('== 0')->name(basename($entry))->in(dirname($entry));
             } else {
                 $find = array();
             }
             foreach ($find as $file) {
                 $result[] = $file;
             }
         }
     }
     return $result;
 }
Exemple #2
0
 /**
  * Perform the compilation process
  * @since 1.1.0
  */
 protected function compile()
 {
     echo "Concrete v{{version}}\nSam-Mauris Yong\n\n";
     if (property_exists($this->config, 'alias')) {
         echo "Setting PHAR alias to " . $this->config->alias . "\n\n";
         $this->phar->setAlias($this->config->alias);
     }
     echo "Compiling PHAR binary...\n";
     $manager = new BuildManager($this->config);
     $result = $manager->process();
     foreach ($result as $entry) {
         if ($entry instanceof \SplFileInfo) {
             echo " + {$entry}\n";
             $this->addFile($entry);
         } elseif ($entry instanceof ProcessorInterface) {
             $this->processor = $entry;
         }
     }
     echo "\nComplete.\n";
 }