...and finally, remove the last binder. Move AuthSignup to use a factory binder.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 22:07:47 +0000 (18:07 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 22:11:06 +0000 (18:11 -0400)
framework/Core/lib/Horde/Core/Binder/AuthSignup.php [deleted file]
framework/Core/lib/Horde/Core/Factory/AuthSignup.php [new file with mode: 0644]
framework/Core/lib/Horde/Registry.php
framework/Core/package.xml

diff --git a/framework/Core/lib/Horde/Core/Binder/AuthSignup.php b/framework/Core/lib/Horde/Core/Binder/AuthSignup.php
deleted file mode 100644 (file)
index 78fc2d6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-/**
- * @category Horde
- * @package  Core
- */
-class Horde_Core_Binder_AuthSignup implements Horde_Injector_Binder
-{
-    public function create(Horde_Injector $injector)
-    {
-        $driver = empty($GLOBALS['conf']['signup']['driver'])
-            ? 'Null'
-            : $GLOBALS['conf']['signup']['driver'];
-
-        return Horde_Core_Auth_Signup::factory($driver, $GLOBALS['conf']['signup']['params']);
-    }
-
-    public function equals(Horde_Injector_Binder $binder)
-    {
-        return false;
-    }
-
-}
diff --git a/framework/Core/lib/Horde/Core/Factory/AuthSignup.php b/framework/Core/lib/Horde/Core/Factory/AuthSignup.php
new file mode 100644 (file)
index 0000000..9baf1d4
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/**
+ * @category Horde
+ * @package  Core
+ */
+class Horde_Core_Factory_AuthSignup
+{
+    public function create(Horde_Injector $injector)
+    {
+        $driver = empty($GLOBALS['conf']['signup']['driver'])
+            ? 'Null'
+            : $GLOBALS['conf']['signup']['driver'];
+
+        return Horde_Core_Auth_Signup::factory($driver, $GLOBALS['conf']['signup']['params']);
+    }
+
+}
index 0572254..4767574 100644 (file)
@@ -248,11 +248,6 @@ class Horde_Registry
             'Horde_Nls' => 'Horde_Core_Autoloader_Callback_Nls'
         );
 
-        /* Define binders. */
-        $binders = array(
-            'Horde_Core_Auth_Signup' => new Horde_Core_Binder_AuthSignup(),
-        );
-
         /* Define factories. */
         $factories = array(
             'Horde_Alarm' => array(
@@ -275,6 +270,10 @@ class Horde_Registry
                 'Horde_Core_Controller_RequestMapper',
                 'getRequestConfiguration',
             ),
+            'Horde_Core_Auth_Signup' => array(
+                'Horde_Core_Factory_AuthSignup',
+                'create',
+            ),
             'Horde_Db_Adapter' => array(
                 'Horde_Core_Factory_DbBase',
                 'create',
@@ -373,9 +372,6 @@ class Horde_Registry
         /* Setup injector. */
         $GLOBALS['injector'] = $injector = new Horde_Injector(new Horde_Injector_TopLevel());
 
-        foreach ($binders as $key => $val) {
-            $injector->addBinder($key, $val);
-        }
         foreach ($factories as $key => $val) {
             $injector->bindFactory($key, $val[0], $val[1]);
         }
index 4ed31e1..8d6cfed 100644 (file)
@@ -109,9 +109,6 @@ Application Framework.</description>
         <file name="Nls.php" role="php" />
        </dir> <!-- /lib/Horde/Core/Autoloader/Callback -->
       </dir> <!-- /lib/Horde/Core/Autoloader -->
-      <dir name="Binder">
-       <file name="AuthSignup.php" role="php" />
-      </dir> <!-- /lib/Horde/Core/Binder -->
       <dir name="Controller">
        <file name="NotFound.php" role="php" />
        <file name="RequestConfiguration.php" role="php" />
@@ -417,7 +414,6 @@ Application Framework.</description>
    <install as="Horde/Core/Auth/Signup/SqlObject.php" name="lib/Horde/Core/Auth/Signup/SqlObject.php" />
    <install as="Horde/Core/Autoloader/Callback/Mime.php" name="lib/Horde/Core/Autoloader/Callback/Mime.php" />
    <install as="Horde/Core/Autoloader/Callback/Nls.php" name="lib/Horde/Core/Autoloader/Callback/Nls.php" />
-   <install as="Horde/Core/Binder/AuthSignup.php" name="lib/Horde/Core/Binder/AuthSignup.php" />
    <install as="Horde/Core/Controller/NotFound.php" name="lib/Horde/Core/Controller/NotFound.php" />
    <install as="Horde/Core/Controller/RequestConfiguration.php" name="lib/Horde/Core/Controller/RequestConfiguration.php" />
    <install as="Horde/Core/Controller/RequestMapper.php" name="lib/Horde/Core/Controller/RequestMapper.php" />