Use a factory binder for History
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 16:31:26 +0000 (12:31 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 16:49:38 +0000 (12:49 -0400)
framework/Core/lib/Horde/Core/Binder/History.php [deleted file]
framework/Core/lib/Horde/Core/Factory/History.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/History.php b/framework/Core/lib/Horde/Core/Binder/History.php
deleted file mode 100644 (file)
index 2bc8a09..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * @category Horde
- * @package  Core
- */
-class Horde_Core_Binder_History implements Horde_Injector_Binder
-{
-    public function create(Horde_Injector $injector)
-    {
-        if (empty($GLOBALS['conf']['sql']['phptype']) ||
-            ($GLOBALS['conf']['sql']['phptype'] == 'none')) {
-            throw new Horde_Exception(_("The History system is disabled."));
-        }
-
-        $ob = Horde_History::factory('Sql', $GLOBALS['conf']['sql']);
-        $ob->setLogger($injector->getInstance('Horde_Log_Logger'));
-
-        return $ob;
-    }
-
-    public function equals(Horde_Injector_Binder $binder)
-    {
-        return false;
-    }
-}
diff --git a/framework/Core/lib/Horde/Core/Factory/History.php b/framework/Core/lib/Horde/Core/Factory/History.php
new file mode 100644 (file)
index 0000000..4f456dc
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * @category Horde
+ * @package  Core
+ */
+class Horde_Core_Factory
+{
+    public function create(Horde_Injector $injector)
+    {
+        if (empty($GLOBALS['conf']['sql']['phptype']) ||
+            ($GLOBALS['conf']['sql']['phptype'] == 'none')) {
+            throw new Horde_Exception(_("The History system is disabled."));
+        }
+
+        $ob = Horde_History::factory('Sql', $GLOBALS['conf']['sql']);
+        $ob->setLogger($injector->getInstance('Horde_Log_Logger'));
+
+        return $ob;
+    }
+
+}
index fd08b00..95db7fe 100644 (file)
@@ -265,7 +265,6 @@ class Horde_Registry
         $binders = array(
             'Horde_Auth_Factory' => new Horde_Core_Binder_AuthFactory(),
             'Horde_Core_Auth_Signup' => new Horde_Core_Binder_AuthSignup(),
-            'Horde_History' => new Horde_Core_Binder_History(),
             'Horde_Http_Client' => new Horde_Core_Binder_HttpClient(),
             'Horde_Log_Logger' => new Horde_Core_Binder_Logger(),
             'Horde_Mail' => new Horde_Core_Binder_Mail(),
@@ -312,6 +311,10 @@ class Horde_Registry
                 'Horde_Core_Factory_Group',
                 'create',
             ),
+            'Horde_History' => array(
+                'Horde_Core_Factory_History',
+                'create',
+            ),
             'Horde_Service_Facebook' => array(
                 'Horde_Core_Factory_Facebook',
                 'create',
index bddbe13..7329206 100644 (file)
@@ -113,7 +113,6 @@ Application Framework.</description>
        <file name="Auth.php" role="php" />
        <file name="AuthFactory.php" role="php" />
        <file name="AuthSignup.php" role="php" />
-       <file name="History.php" role="php" />
        <file name="HttpClient.php" role="php" />
        <file name="Identity.php" role="php" />
        <file name="Logger.php" role="php" />
@@ -146,6 +145,7 @@ Application Framework.</description>
        <file name="Editor.php" role="php" />
        <file name="Facebook.php" role="php" />
        <file name="Group.php" role="php" />
+       <file name="History.php" role="php" />
        <file name="HttpClient.php" role="php" />
        <file name="Identity.php" role="php" />
        <file name="Imple.php" role="php" />
@@ -427,7 +427,6 @@ Application Framework.</description>
    <install as="Horde/Core/Binder/Auth.php" name="lib/Horde/Core/Binder/Auth.php" />
    <install as="Horde/Core/Binder/AuthFactory.php" name="lib/Horde/Core/Binder/AuthFactory.php" />
    <install as="Horde/Core/Binder/AuthSignup.php" name="lib/Horde/Core/Binder/AuthSignup.php" />
-   <install as="Horde/Core/Binder/History.php" name="lib/Horde/Core/Binder/History.php" />
    <install as="Horde/Core/Binder/HttpClient.php" name="lib/Horde/Core/Binder/HttpClient.php" />
    <install as="Horde/Core/Binder/Identity.php" name="lib/Horde/Core/Binder/Identity.php" />
    <install as="Horde/Core/Binder/Logger.php" name="lib/Horde/Core/Binder/Logger.php" />
@@ -457,6 +456,7 @@ Application Framework.</description>
    <install as="Horde/Core/Factory/Facebook.php" name="lib/Horde/Core/Factory/Facebook.php" />
    <install as="Horde/Core/Factory/Group.php" name="lib/Horde/Core/Factory/Group.php" />
    <install as="Horde/Core/Factory/HttpClient.php" name="lib/Horde/Core/Factory/HttpClient.php" />
+   <install as="Horde/Core/Factory/History.php" name="lib/Horde/Core/Factory/History.php" />
    <install as="Horde/Core/Factory/Identity.php" name="lib/Horde/Core/Factory/Identity.php" />
    <install as="Horde/Core/Factory/Imple.php" name="lib/Horde/Core/Factory/Imple.php" />
    <install as="Horde/Core/Factory/KolabServer.php" name="lib/Horde/Core/Factory/KolabServer.php" />