Author: Arne Blankerts (arne@blankerts.de)
Ejemplo n.º 1
0
 public function getInstanceFor(BuildConfig $buildCfg)
 {
     $name = $buildCfg->getEngine();
     if (!isset($this->engines[$name])) {
         throw new FactoryException("Engine '{$name}' is not registered.", FactoryException::UnknownEngine);
     }
     if (isset($this->configs[$name])) {
         $cfg = new $this->configs[$name]($buildCfg->getGeneratorConfig(), $buildCfg->getBuildNode());
     } else {
         $cfg = $buildCfg;
     }
     if ($this->engines[$name] instanceof FactoryInterface) {
         return $this->engines[$name]->getInstanceFor($name, $cfg);
     }
     return new $this->engines[$name]($cfg);
 }
Ejemplo n.º 2
0
 public function __construct(BuildConfig $config)
 {
     $this->outputDir = $config->getOutputDirectory();
 }