Remove extra layer, create the Horde_Core_Auth_Signup object directly in the factory.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 22:19:23 +0000 (18:19 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 22:21:19 +0000 (18:21 -0400)
framework/Core/lib/Horde/Core/Auth/Signup.php [deleted file]
framework/Core/lib/Horde/Core/Factory/AuthSignup.php
framework/Core/package.xml

diff --git a/framework/Core/lib/Horde/Core/Auth/Signup.php b/framework/Core/lib/Horde/Core/Auth/Signup.php
deleted file mode 100644 (file)
index bba7e40..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * This class provides an interface to sign up or have new users sign
- * themselves up into the horde installation, depending on how the admin has
- * configured Horde.
- *
- * Copyright 2002-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you did
- * not receive this file, see http://opensource.org/licenses/lgpl-2.1.php
- *
- * @author   Marko Djukic <marko@oblo.com>
- * @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.');
-    }
-
-}
index 9baf1d4..e795f59 100644 (file)
@@ -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');
     }
 
 }
index 8d6cfed..146103e 100644 (file)
@@ -101,7 +101,6 @@ Application Framework.</description>
        <file name="Ldap.php" role="php" />
        <file name="Msad.php" role="php" />
        <file name="Shibboleth.php" role="php" />
-       <file name="Signup.php" role="php" />
       </dir> <!-- /lib/Horde/Core/Auth -->
       <dir name="Autoloader">
        <dir name="Callback">
@@ -406,7 +405,6 @@ Application Framework.</description>
    <install as="Horde/Core/Auth/Ldap.php" name="lib/Horde/Core/Auth/Ldap.php" />
    <install as="Horde/Core/Auth/Msad.php" name="lib/Horde/Core/Auth/Msad.php" />
    <install as="Horde/Core/Auth/Shibboleth.php" name="lib/Horde/Core/Auth/Shibboleth.php" />
-   <install as="Horde/Core/Auth/Signup.php" name="lib/Horde/Core/Auth/Signup.php" />
    <install as="Horde/Core/Auth/Signup/Base.php" name="lib/Horde/Core/Auth/Signup/Base.php" />
    <install as="Horde/Core/Auth/Signup/Form.php" name="lib/Horde/Core/Auth/Signup/Form.php" />
    <install as="Horde/Core/Auth/Signup/Null.php" name="lib/Horde/Core/Auth/Signup/Null.php" />