From c35587c7e2193a6b2ceb47aa20e8c9f05c85f19f Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Wed, 14 Jan 2015 21:00:08 +0100 Subject: [PATCH] create caache directory for remote download if it does not exists #43 --- CImage.php | 7 ++++++- README.md | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CImage.php b/CImage.php index e301694..86c70ab 100644 --- a/CImage.php +++ b/CImage.php @@ -473,8 +473,13 @@ class CImage public function downloadRemoteSource($src) { $remote = new CRemoteImage(); + $cache = $this->saveFolder . "/remote/"; + + if (!is_dir($cache)) { + mkdir($cache); + $this->log("The remote cache does not exists, creating it."); + } - $cache = $this->saveFolder . "/remote/"; if (!is_writable($cache)) { $this->log("The remote cache is not writable."); } diff --git a/README.md b/README.md index 32f6e20..d2ff94e 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ Revision history v0.6.x (latest) +* Create cache directory for remote download if it does not exists. * Cleaned up `img_config.php` and introduced default values for almost all options #72.