function __construct($root = null) { $this->root = $root; $this->loadPaths = new FileUtils\PathStack($this->root); $this->engines = Template::getEngines(); # Enable resolving logical paths without extension. $this->loadPaths->appendExtensions(array_keys($this->engines->getEngines())); $this->loadPaths->appendExtensions(array_keys($this->contentTypes)); $this->preProcessors = new ProcessorRegistry(); $this->postProcessors = new ProcessorRegistry(); $this->bundleProcessors = new ProcessorRegistry(); $this->registerEngine('\\Pipe\\JstProcessor', '.jst'); # Override Mustache compiler with more useful Mustache to JS compiler, # which is usable with the JST processor $this->registerEngine('\\MetaTemplate\\Template\\MustacheJsTemplate', '.mustache'); # Register default processors $this->registerPreProcessor('text/css', '\\Pipe\\ImportProcessor'); $this->registerPreProcessor('text/css', '\\Pipe\\DirectiveProcessor'); $this->registerPreProcessor('application/javascript', '\\Pipe\\DirectiveProcessor'); $this->registerPostProcessor('application/javascript', '\\Pipe\\SafetyColons'); }