1 : <?php
2 :
3 : /**
4 : * dwoo compilation exception class
5 : *
6 : * This software is provided 'as-is', without any express or implied warranty.
7 : * In no event will the authors be held liable for any damages arising from the use of this software.
8 : *
9 : * @author Jordi Boggiano <j.boggiano@seld.be>
10 : * @copyright Copyright (c) 2008, Jordi Boggiano
11 : * @license http://dwoo.org/LICENSE Modified BSD License
12 : * @link http://dwoo.org/
13 : * @version 1.0.0
14 : * @date 2008-10-23
15 : * @package Dwoo
16 : */
17 : class Dwoo_Compilation_Exception extends Dwoo_Exception
18 : {
19 : protected $compiler;
20 : protected $template;
21 :
22 : public function __construct(Dwoo_Compiler $compiler, $message)
23 : {
24 9 : $this->compiler = $compiler;
25 9 : $this->template = $compiler->getDwoo()->getTemplate();
26 9 : parent::__construct('Compilation error at line '.$compiler->getLine().' in "'.$this->template->getResourceName().':'.$this->template->getResourceIdentifier().'" : '.$message);
27 9 : }
28 :
29 : public function getCompiler()
30 : {
31 0 : return $this->compiler;
32 : }
33 :
34 : public function getTemplate()
35 : {
36 0 : return $this->template;
37 : }
38 : }
|