From c19829233a8aafc57f1e58342a0bfd9a0bfb5e35 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Mon, 28 Sep 2015 15:21:43 +0200 Subject: [PATCH] Adding cache folder if nto exist --- api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.php b/api.php index e43de9e..a51824e 100644 --- a/api.php +++ b/api.php @@ -49,7 +49,8 @@ if(!$cache) $cache = md5(time().rand(1,2000)); $hash = $cache.'-'.preg_replace("/[^A-Za-z0-9 ]/", '', $url).'.'.$ft; - +if(!is_dir(__DIR__.'/cache/')) + mkdir(__DIR__.'/cache/'); $file = __DIR__.'/cache/'.$hash; if(!file_exists($file)) shell_exec('timeout '.$timeout.' /usr/sbin/wkhtmltoimage '.escapeshellcmd($vp.$jsp.'-f '.$ft.' '.$url.' '.$file));