コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: ViewElementTag.php プロジェクト: tboloo/figdice
 /**
  * @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();
 }
コード例 #3
0
ファイル: View.php プロジェクト: tboloo/figdice
 /**
  * @return string
  */
 public function getFilename()
 {
     return $this->file->getFilename();
 }