Exemplo n.º 1
0
 public function __construct(ComplexAttributeFactory $complexAttributeFactory, Document $document = null)
 {
     $this->document = $document;
     $factory = new NodeFactory();
     $stylesheetParser = new StylesheetParser(null, true);
     $stylesheetParser->setComplexAttributeFactory($complexAttributeFactory);
     $this->setNodeFactory($factory);
     $this->setStylesheetParser($stylesheetParser);
     $this->setComplexAttributeFactory($complexAttributeFactory);
     $this->nodeManager = new Manager();
     $this->setBehaviourFactory(new BehaviourFactory());
     $this->initialize();
 }
Exemplo n.º 2
0
 /**
  * Create Facade object
  *
  * @return Facade
  */
 public function build()
 {
     $documentParser = $this->createDocumentParser();
     $stylesheetParser = new StylesheetParser();
     $stylesheetParser->setComplexAttributeFactory($this->configurationLoader->createComplexAttributeFactory());
     $engine = $this->engineFactory->createEngine($this->engineType, $this->engineOptions);
     $document = new Document($engine);
     $this->addStringFiltersTo($document);
     $facade = new Facade($this->configurationLoader, $document, $documentParser, $stylesheetParser);
     $this->addStringFiltersTo($facade);
     $facade->setEngineType($this->engineType);
     if ($documentParser instanceof FacadeAware) {
         $documentParser->setFacade($facade);
     }
     $facade->setUseCacheForStylesheetConstraint($this->useCacheForStylesheetConstraint);
     if ($this->cacheType && $this->cacheType !== 'Null') {
         $cache = new CacheImpl($this->cacheType, $this->cacheOptions);
         $facade->setCache($cache);
         if ($this->useCacheForConfigurationLoader) {
             $this->configurationLoader->setCache($cache);
         }
     }
     return $facade;
 }