From ba4549fec37659904d8374198328fc1d43b15d4a Mon Sep 17 00:00:00 2001 From: vitalif Date: Wed, 20 Feb 2013 22:43:54 +0000 Subject: [PATCH] Log error message, suppress php errors --- template.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/template.php b/template.php index d3d1f28..cec84e3 100644 --- a/template.php +++ b/template.php @@ -262,7 +262,8 @@ class VMXTemplate } if (!($text = $this->loadfile($fn))) { - $this->options->error("couldn't load template file '$fn'", true); + $e = error_get_last(); + $this->options->error("couldn't load template file '$fn': ".$e['message'], true); $this->failed[$fn] = true; return NULL; } @@ -342,7 +343,7 @@ class VMXTemplate $load = false; if (!($text = self::cache_get("U$fn")) || $this->options->reload) { - $mtime = stat($fn); + $mtime = @stat($fn); $mtime = $mtime[9]; if (!$text) { @@ -360,7 +361,7 @@ class VMXTemplate // Reload if file changed if ($load) { - if ($fp = fopen($fn, "rb")) + if ($fp = @fopen($fn, "rb")) { fseek($fp, 0, SEEK_END); $t = ftell($fp);