From ff69ab061e00228d254232bc0049828415bfebef Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 14 May 2010 12:21:01 -0600 Subject: [PATCH] Removed Horde_Util::assertDriverConfig() --- beatnik/lib/Driver/pdnsgsql.php | 4 +--- framework/Core/lib/Horde/Core/Binder/Common.php | 2 +- framework/Util/lib/Horde/Util.php | 31 ------------------------- framework/Util/package.xml | 9 +++++-- 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/beatnik/lib/Driver/pdnsgsql.php b/beatnik/lib/Driver/pdnsgsql.php index 736d0f671..808b9e456 100644 --- a/beatnik/lib/Driver/pdnsgsql.php +++ b/beatnik/lib/Driver/pdnsgsql.php @@ -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; diff --git a/framework/Core/lib/Horde/Core/Binder/Common.php b/framework/Core/lib/Horde/Core/Binder/Common.php index 6304bc8df..356cef7e5 100644 --- a/framework/Core/lib/Horde/Core/Binder/Common.php +++ b/framework/Core/lib/Horde/Core/Binder/Common.php @@ -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' => '', diff --git a/framework/Util/lib/Horde/Util.php b/framework/Util/lib/Horde/Util.php index 69ad67919..f70f35121 100644 --- a/framework/Util/lib/Horde/Util.php +++ b/framework/Util/lib/Horde/Util.php @@ -13,12 +13,6 @@ */ 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. diff --git a/framework/Util/package.xml b/framework/Util/package.xml index 07c84b1a2..3b2ff07d0 100644 --- a/framework/Util/package.xml +++ b/framework/Util/package.xml @@ -29,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Removed Horde_Util::bufferOutput(). + * 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"> 5.2.0 - 1.5.4 + 1.7.0 Url @@ -93,6 +94,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> xml + + Imap_Client + pear.horde.org + -- 2.11.0