From fcde140a57b730af75f512d771976cd6e1ac5e38 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Tue, 6 May 2014 17:46:13 +0400 Subject: [PATCH] Use configuration option for cache image dir --- Upload.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Upload.class.php b/Upload.class.php index fe0c227..efb7598 100644 --- a/Upload.class.php +++ b/Upload.class.php @@ -11,7 +11,9 @@ abstract class Upload public static function &getGreagwarImage($file_path) { $greagwar_image = new GreagwarImage($file_path); - $greagwar_image->setCacheDir(Config::get('PATH_WEB_ROOT') . DIRECTORY_SEPARATOR . self::$dir_image_cache); + $config_upload = Config::get('Upload'); + $dir_image_cache = $config_upload ? $config_upload->dir_image_cache : self::$dir_image_cache; + $greagwar_image->setCacheDir(Config::get('PATH_WEB_ROOT') . DIRECTORY_SEPARATOR . $dir_image_cache); return $greagwar_image; }