+++ /dev/null
-<?php
-/**
- * @category Horde
- * @package Core
- */
-class Horde_Core_Binder_Mail implements Horde_Injector_Binder
-{
- public function create(Horde_Injector $injector)
- {
- $transport = isset($GLOBALS['conf']['mailer']['type'])
- ? $GLOBALS['conf']['mailer']['type']
- : 'null';
- $params = isset($GLOBALS['conf']['mailer']['params'])
- ? $GLOBALS['conf']['mailer']['params']
- : array();
-
- if (($transport == 'smtp') &&
- $params['auth'] &&
- empty($params['username'])) {
- $params['username'] = $GLOBALS['registry']->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;
- }
-}
--- /dev/null
+<?php
+/**
+ * @category Horde
+ * @package Core
+ */
+class Horde_Core_Factory_Mail
+{
+ public function create(Horde_Injector $injector)
+ {
+ $transport = isset($GLOBALS['conf']['mailer']['type'])
+ ? $GLOBALS['conf']['mailer']['type']
+ : 'null';
+ $params = isset($GLOBALS['conf']['mailer']['params'])
+ ? $GLOBALS['conf']['mailer']['params']
+ : array();
+
+ if (($transport == 'smtp') &&
+ $params['auth'] &&
+ empty($params['username'])) {
+ $params['username'] = $GLOBALS['registry']->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);
+ }
+
+}
$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(),
'Horde_Core_Factory_Lock',
'create',
),
+ 'Horde_Mail' => array(
+ 'Horde_Core_Factory_Mail',
+ 'create',
+ ),
'Horde_Memcache' => array(
'Horde_Core_Factory_Memcache',
'create',
<file name="Auth.php" role="php" />
<file name="AuthFactory.php" role="php" />
<file name="AuthSignup.php" role="php" />
- <file name="Mail.php" role="php" />
<file name="Mapper.php" role="php" />
<file name="MimeViewer.php" role="php" />
<file name="ShareFactory.php" role="php" />
<file name="Lock.php" role="php" />
<file name="Logger.php" role="php" />
<file name="LoginTasks.php" role="php" />
+ <file name="Mail.php" role="php" />
<file name="Memcache.php" role="php" />
<file name="MimeViewer.php" role="php" />
<file name="Notification.php" role="php" />
<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/Mail.php" name="lib/Horde/Core/Binder/Mail.php" />
<install as="Horde/Core/Binder/Mapper.php" name="lib/Horde/Core/Binder/Mapper.php" />
<install as="Horde/Core/Binder/MimeViewer.php" name="lib/Horde/Core/Binder/MimeViewer.php" />
<install as="Horde/Core/Binder/ShareFactory.php" name="lib/Horde/Core/Binder/ShareFactory.php" />
<install as="Horde/Core/Factory/Lock.php" name="lib/Horde/Core/Factory/Lock.php" />
<install as="Horde/Core/Factory/Logger.php" name="lib/Horde/Core/Factory/Logger.php" />
<install as="Horde/Core/Factory/LoginTasks.php" name="lib/Horde/Core/Factory/LoginTasks.php" />
+ <install as="Horde/Core/Factory/Mail.php" name="lib/Horde/Core/Factory/Mail.php" />
<install as="Horde/Core/Factory/Memcache.php" name="lib/Horde/Core/Factory/Memcache.php" />
<install as="Horde/Core/Factory/MimeViewer.php" name="lib/Horde/Core/Factory/MimeViewer.php" />
<install as="Horde/Core/Factory/Notification.php" name="lib/Horde/Core/Factory/Notification.php" />