From 3b1f4f84fbabf203c7212fe5ec909a617ff2d19f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 19 Sep 2013 13:43:44 +0200 Subject: [PATCH] fixed error management as hhvm returns a directory in a stacktrace when the file is eval'ed (more like a hack than anything else) --- lib/Twig/Error.php | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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; -- 1.7.2.5