From d6aeae6c975cc4d169deddaf9453e99d30caac01 Mon Sep 17 00:00:00 2001 From: alrusdi Date: Fri, 14 Dec 2012 16:29:47 +0600 Subject: [PATCH] refs #4677 Added a configuration option to define default driver for Image library --- classes/Kohana/Image.php | 5 +++-- config/image.php | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 config/image.php diff --git a/classes/Kohana/Image.php b/classes/Kohana/Image.php index 3fe91fc..27e0976 100644 --- a/classes/Kohana/Image.php +++ b/classes/Kohana/Image.php @@ -44,8 +44,9 @@ abstract class Kohana_Image { { if ($driver === NULL) { - // Use the default driver - $driver = Image::$default_driver; + // Use the driver from configuration file or default one + $configured_driver = Kohana::$config->load('image.default_driver'); + $driver = ($configured_driver) ? $configured_driver : Image::$default_driver; } // Set the class name diff --git a/config/image.php b/config/image.php new file mode 100644 index 0000000..6443264 --- /dev/null +++ b/config/image.php @@ -0,0 +1,6 @@ + 'Imagick', +); -- 2.11.4.GIT