From 6a64863d678589d3ecbce8a97c075d2bcd84d7ae Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 7 Oct 2010 18:19:23 -0400 Subject: [PATCH] Remove extra layer, create the Horde_Core_Auth_Signup object directly in the factory. --- framework/Core/lib/Horde/Core/Auth/Signup.php | 42 ---------------------- .../Core/lib/Horde/Core/Factory/AuthSignup.php | 6 +++- framework/Core/package.xml | 2 -- 3 files changed, 5 insertions(+), 45 deletions(-) delete mode 100644 framework/Core/lib/Horde/Core/Auth/Signup.php diff --git a/framework/Core/lib/Horde/Core/Auth/Signup.php b/framework/Core/lib/Horde/Core/Auth/Signup.php deleted file mode 100644 index bba7e4093..000000000 --- a/framework/Core/lib/Horde/Core/Auth/Signup.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @category Horde - * @license http://opensource.org/licenses/lgpl-2.1.php LGPL - * @package Core - */ -class Horde_Core_Auth_Signup -{ - /** - * Attempts to return a concrete instance based on $driver. - * - * @param string $driver The type of the concrete subclass to return. - * @param array $params A hash containing any additional configuration - * or connection parameters a subclass might need. - * - * @return Horde_Core_Auth_Signup_Base The newly created concrete - * instance. - * @throws Horde_Exception - */ - static public function factory($driver, $params = array()) - { - $driver = Horde_String::ucfirst(basename($driver)); - $class = __CLASS__ . '_' . $driver; - - if (class_exists($class)) { - return new $class($params); - } - - throw new Horde_Exception(__CLASS__ . ' driver (' . $class . ') not found.'); - } - -} diff --git a/framework/Core/lib/Horde/Core/Factory/AuthSignup.php b/framework/Core/lib/Horde/Core/Factory/AuthSignup.php index 9baf1d4f7..e795f591e 100644 --- a/framework/Core/lib/Horde/Core/Factory/AuthSignup.php +++ b/framework/Core/lib/Horde/Core/Factory/AuthSignup.php @@ -11,7 +11,11 @@ class Horde_Core_Factory_AuthSignup ? 'Null' : $GLOBALS['conf']['signup']['driver']; - return Horde_Core_Auth_Signup::factory($driver, $GLOBALS['conf']['signup']['params']); + $class = 'Horde_Core_Auth_Signup_' . Horde_String::ucfirst($driver); + if (class_exists($class)) { + return new $class($GLOBALS['conf']['signup']['params']); + } + throw new Horde_Exception($class . ' driver not found'); } } diff --git a/framework/Core/package.xml b/framework/Core/package.xml index 8d6cfeda9..146103ee3 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -101,7 +101,6 @@ Application Framework. - @@ -406,7 +405,6 @@ Application Framework. - -- 2.11.0