From: Gunnar Wrobel
Date: Wed, 28 Oct 2009 21:38:37 +0000 (+0100)
Subject: Configuration based factories should not require any parameters but the configuration.
X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9fb759a2f41cf71871a242e4f021faf05951da1b;p=horde.git
Configuration based factories should not require any parameters but the configuration.
---
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php
index c54ca489e..b031dd9be 100644
--- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php
+++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php
@@ -44,15 +44,18 @@ implements Horde_Kolab_Server_Factory
/**
* Constructor.
- *
- * @param array $config Configuration parameters for the server.
*/
- public function __construct(
- Horde_Kolab_Server_Factory $factory,
- array $config
- ) {
+ public function __construct(array $config)
+ {
$this->_configuration = $config;
+ $connection_factory = new Horde_Kolab_Server_Factory_Conn_Configuration(
+ $config
+ );
+ $factory = new Horde_Kolab_Server_Factory_Kolab(
+ $connection_factory, $config
+ );
+
if (isset($config['logger'])) {
$factory = new Horde_Kolab_Server_Factory_Logged(
$factory, $config['logger']
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Conn/Configuration.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Conn/Configuration.php
new file mode 100644
index 000000000..6f4dba1dd
--- /dev/null
+++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Conn/Configuration.php
@@ -0,0 +1,92 @@
+
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Kolab_Server
+ */
+
+/**
+ * A factory that receives all required details via configuration parameters.
+ *
+ * Copyright 2009 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://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Kolab
+ * @package Kolab_Server
+ * @author Gunnar Wrobel