Removed Horde_Util::assertDriverConfig()
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 14 May 2010 18:21:01 +0000 (12:21 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 14 May 2010 18:46:09 +0000 (12:46 -0600)
beatnik/lib/Driver/pdnsgsql.php
framework/Core/lib/Horde/Core/Binder/Common.php
framework/Util/lib/Horde/Util.php
framework/Util/package.xml

index 736d0f6..808b9e4 100644 (file)
@@ -421,9 +421,7 @@ class Beatnik_Driver_pdnsgsql extends Beatnik_Driver
         }
 
         try {
-            $result = Horde_Util::assertDriverConfig($this->_params, array('phptype'),
-                                               'PowerDNS Generic SQL',
-                                               array('driver' => 'pdnsgsql'));
+            $result = Horde::assertDriverConfig($this->_params, 'pdnsqsql', array('phptype'), 'PowerDNS Generic SQL');
         } catch (Exception $e) {
             Horde::logMessage($e, 'ERR');
             throw $e;
index 6304bc8..356cef7 100644 (file)
@@ -8,7 +8,7 @@ class Horde_Core_Binder_Common
     /* Utility function to use until code is transferred to new DB code. */
     public function createDb($params, $ident)
     {
-        Horde_Util::assertDriverConfig($params, array('charset', 'phptype'), $ident);
+        Horde::assertDriverConfig($params, 'sql', array('charset', 'phptype'), $ident);
 
         $params = array_merge(array(
             'database' => '',
index 69ad679..f70f351 100644 (file)
  */
 class Horde_Util
 {
-    /* Error code for a missing driver configuration. */
-    const DRIVER_CONFIG_MISSING = 1;
-
-    /* Error code for an incomplete driver configuration. */
-    const DRIVER_CONFIG = 2;
-
     /**
      * A list of random patterns to use for overwriting purposes.
      * See http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html.
@@ -662,31 +656,6 @@ class Horde_Util
     }
 
     /**
-     * Checks if all necessary parameters for a driver's configuration are set
-     * and throws an exception if something is missing.
-     *
-     * @param array $params   The configuration array with all parameters.
-     * @param array $fields   An array with mandatory parameter names for this
-     *                        driver.
-     * @param string $name    The clear text name of the driver. If not
-     *                        specified, the application name will be used.
-     *
-     * @throws Horde_Exception
-     */
-    static public function assertDriverConfig($params, $fields, $name)
-    {
-        if (!is_array($params) || !count($params)) {
-            throw new Horde_Exception(sprintf('No configuration information specified for %s.', $name), self::DRIVER_CONFIG_MISSING);
-        }
-
-        foreach ($fields as $field) {
-            if (!isset($params[$field])) {
-                throw new Horde_Exception(sprintf('Required "%s" not specified in configuration.', $field, $name), self::DRIVER_CONFIG);
-            }
-        }
-    }
-
-    /**
      * Utility function to obtain PATH_INFO information.
      *
      * @return string  The PATH_INFO string.
index 07c84b1..3b2ff07 100644 (file)
@@ -29,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Removed Horde_Util::bufferOutput().
+ <notes>* Removed Horde_Util::assertDriverConfig().
+ * Removed Horde_Util::bufferOutput().
  * Removed Horde_Util::uriB64Encode() and Horde_Util::uriB64Decode().
  * Removed Horde_Util::strftime2date() and Horde_Util::date2strftime().
  * Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl().
@@ -76,7 +77,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <min>5.2.0</min>
    </php>
    <pearinstaller>
-    <min>1.5.4</min>
+    <min>1.7.0</min>
    </pearinstaller>
    <package>
     <name>Url</name>
@@ -93,6 +94,10 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <extension>
     <name>xml</name>
    </extension>
+   <package>
+    <name>Imap_Client</name>
+    <channel>pear.horde.org</channel>
+   </package>
   </optional>
  </dependencies>
  <phprelease>