public function __construct($dictionaryName, File $file, $xmlLineNumber) { parent::__construct('Dictionary "' . $dictionaryName . '" not found in template: ' . $file->getFilename() . '(' . $xmlLineNumber . ')'); $this->dictionaryName = $dictionaryName; $this->file = $file->getFilename(); $this->line = $xmlLineNumber; }
/** * @return Filter */ private function instanciateFilter($className) { if (!class_exists($className)) { $classFile = $className . '.php'; if (realpath($classFile) != $classFile) { $classFile = $this->view->getFilterPath() . '/' . $classFile; } if (!file_exists($classFile)) { $message = 'Filter file not found: ' . $classFile . ' in Fig source: ' . $this->currentFile->getFilename() . "({$this->xmlLineNumber})"; throw new FileNotFoundException($message, $classFile); } require_once $classFile; //Check that the loaded file did declare the requested class: if (!class_exists($className)) { $message = "Undefined filter class: {$className} in file: {$classFile}"; throw new RenderingException($this->getTagName(), $this->getCurrentFilename(), $this->getLineNumber(), $message); } } if ($this->view->getFilterFactory()) { return $this->view->getFilterFactory()->create($className); } $reflection = new \ReflectionClass($className); return $reflection->newInstance(); }
/** * @return string */ public function getFilename() { return $this->file->getFilename(); }