From: Michael J. Rubinsky Date: Thu, 7 Oct 2010 17:09:19 +0000 (-0400) Subject: Use a factory binder for Horde_Mail, not a binder X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d58ac8ffdcc05511d9cf6f804de428d91174266a;p=horde.git Use a factory binder for Horde_Mail, not a binder --- diff --git a/framework/Core/lib/Horde/Core/Binder/Mail.php b/framework/Core/lib/Horde/Core/Binder/Mail.php deleted file mode 100644 index 94fa3ab46..000000000 --- a/framework/Core/lib/Horde/Core/Binder/Mail.php +++ /dev/null @@ -1,35 +0,0 @@ -getAuth(); - $params['password'] = $GLOBALS['registry']->getAuthCredential('password'); - } - - $class = 'Horde_Mail_Transport_' . ucfirst($transport); - if (class_exists($class)) { - return new $class($params); - } - throw new Horde_Exception('Unable to find class for transport ' . $transport); - } - - public function equals(Horde_Injector_Binder $binder) - { - return false; - } -} diff --git a/framework/Core/lib/Horde/Core/Factory/Mail.php b/framework/Core/lib/Horde/Core/Factory/Mail.php new file mode 100644 index 000000000..a755c0200 --- /dev/null +++ b/framework/Core/lib/Horde/Core/Factory/Mail.php @@ -0,0 +1,31 @@ +getAuth(); + $params['password'] = $GLOBALS['registry']->getAuthCredential('password'); + } + + $class = 'Horde_Mail_Transport_' . ucfirst($transport); + if (class_exists($class)) { + return new $class($params); + } + throw new Horde_Exception('Unable to find class for transport ' . $transport); + } + +} diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 658469c37..33165044f 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -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_Mail' => new Horde_Core_Binder_Mail(), 'Horde_Mime_Viewer' => new Horde_Core_Binder_MimeViewer(), 'Horde_Share_Factory' => new Horde_Core_Binder_ShareFactory(), 'Horde_Template' => new Horde_Core_Binder_Template(), @@ -336,6 +335,10 @@ class Horde_Registry 'Horde_Core_Factory_Lock', 'create', ), + 'Horde_Mail' => array( + 'Horde_Core_Factory_Mail', + 'create', + ), 'Horde_Memcache' => array( 'Horde_Core_Factory_Memcache', 'create', diff --git a/framework/Core/package.xml b/framework/Core/package.xml index 868ffbef2..9441c2a88 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -113,7 +113,6 @@ Application Framework. - @@ -153,6 +152,7 @@ Application Framework. + @@ -425,7 +425,6 @@ Application Framework. - @@ -461,6 +460,7 @@ Application Framework. +