Add configuration option for no image driver, and have Ansel make sure we have one.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 15 Feb 2010 17:59:54 +0000 (12:59 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 15 Feb 2010 17:59:54 +0000 (12:59 -0500)
ansel/lib/Application.php
horde/config/conf.xml

index cf27dbb..f470d63 100644 (file)
@@ -57,6 +57,10 @@ class Ansel_Application extends Horde_Registry_Application
      */
     protected function _init()
     {
+        if (!$GLOBALS['conf']['image']['driver']) {
+            throw new Horde_Exception('You must configure a Horde_Image driver to use Ansel');
+        }
+        
         // Create a cache object if we need it.
         if ($GLOBALS['conf']['ansel_cache']['usecache']) {
             $GLOBALS['cache'] = $GLOBALS['injector']->getInstance('Horde_Cache');
index 9553a0d..9afb2ef 100644 (file)
    <configheader>Image Manipulation Settings</configheader>
    <configswitch name="driver" description="What driver should we use for
    manipulating images?">Im
+   <case name="false" desc="None"></case>
+   <case name="Imagick" desc="The PECL Imagick Library (recommended)"></case>
    <case name="Im" desc="Imagemagick">
      <configstring name="convert" desc="Path to the 'convert' binary"></configstring>
      <configstring name="identify" desc="Path the 'identify' binary"></configstring>
    </case>
-   <case name="Imagick" desc="The PECL Imagick Library"></case>
-   <case name="Gd" desc="The PHP GD2 extensions (not recommended)."></case>
+   <case name="Gd" desc="The PHP GD2 extensions (not recommended)"></case>
    </configswitch>
   </configsection>
   <configsection name="exif" desc="Image Metadata">