From: Fabien Potencier Date: Thu, 19 Sep 2013 11:43:44 +0000 (+0200) Subject: fixed error management as hhvm returns a directory in a stacktrace when the file... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3b1f4f84fbabf203c7212fe5ec909a617ff2d19f;p=web%2Fkonrad%2Ftwig.git fixed error management as hhvm returns a directory in a stacktrace when the file is eval'ed (more like a hack than anything else) --- diff --git a/lib/Twig/Error.php b/lib/Twig/Error.php index 61a4cfa..914b3ed 100644 --- a/lib/Twig/Error.php +++ b/lib/Twig/Error.php @@ -217,6 +217,11 @@ class Twig_Error extends Exception $r = new ReflectionObject($template); $file = $r->getFileName(); + // hhvm has a bug where eval'ed files comes out as the current directory + if (is_dir($file)) { + $file = ''; + } + $exceptions = array($e = $this); while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) { $exceptions[] = $e;