public function __construct(Loader $configurationLoader, Document $document, DocumentParser $documentParser, StylesheetParser $stylesheetParser) { $this->configurationLoader = $configurationLoader; $this->configurationLoader->setUnitConverter($document); $this->setCache(NullCache::getInstance()); $documentParser->setDocument($document); $nodeManager = $documentParser->getNodeManager(); if ($nodeManager) { $documentParser->addListener($nodeManager); } $this->setDocumentParser($documentParser); $this->setStylesheetParser($stylesheetParser); $this->setDocument($document); }
public function __construct($nodeFile = null, $complexAttributeFile = null, $fontFiles = null, $colorFile = null) { if ($nodeFile === null) { $nodeFile = __DIR__ . '/../../Resources/config/nodes.xml'; } if ($complexAttributeFile === null) { $complexAttributeFile = __DIR__ . '/../../Resources/config/complex-attributes.xml'; } if (!$fontFiles) { $fontFiles = array('pdf' => __DIR__ . '/../../Resources/config/fonts.xml', 'image' => __DIR__ . '/../../Resources/config/fonts-image.xml'); } if ($colorFile === null) { $colorFile = __DIR__ . '/../../Resources/config/colors.xml'; } $this->nodeFile = $nodeFile; $this->complexAttributeFile = $complexAttributeFile; $this->setFontFile($fontFiles); $this->colorFile = $colorFile; $this->setCache(NullCache::getInstance()); }