public function preParse() { global $tag_dictionary; if (! array_key_exists('file', $this->attributes) || empty($this->attributes['file'])) { throw new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'file', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } $file = $this->attributes['file']; if (!$this->resolved_source_file = resolveTemplateSourceFileName($file)) { throw new WactException('missing file', array('tag' => $this->tag, 'srcfile' => $file, 'file' => $this->source_file, 'line' => $this->starting_line_no)); } if (array_key_exists('literal', $this->attributes)) { $literal_component = new TextNode(readTemplateFile($this->resolved_source_file)); $this->addChild($literal_component); } else { $sfp = new SourceFileParser($this->resolved_source_file, $tag_dictionary); $sfp->parse($this); } return PARSER_FORBID_PARSING; }
/** * Provide local method of same name to help with Unit testing */ protected function readTemplateFile($sourcefile) { return readTemplateFile($sourcefile); }