public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null)
{
if (-1 === $lineno || null === $filename) {
- list($lineno, $filename) = $this->findTemplateInfo(null !== $previous ? $previous : $this);
+ list($lineno, $filename) = $this->findTemplateInfo(null !== $previous ? $previous : $this, $lineno, $filename);
}
$this->lineno = $lineno;
}
}
- protected function findTemplateInfo(Exception $e)
+ protected function findTemplateInfo(Exception $e, $currentLine, $currentFile)
{
if (!function_exists('token_get_all')) {
- return array(-1, null);
+ return array($currentLine, $currentFile);
}
$traces = $e->getTrace();
if (!file_exists($r->getFilename())) {
// probably an eval()'d code
- return array(-1, null);
+ return array($currentLine, $currentFile);
}
$trace = $traces[$i - 1];
}
}
- return array(-1, $template);
+ return array($currentLine, $template);
}
- return array(-1, null);
+ return array($currentLine, $currentFile);
}
}