1: <?php
2: /**
3: * Copyright 2010-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2010-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * A factory to allow for IMP's mail configuration to override the default
16: * Horde configuration.
17: *
18: * @author Michael Slusarz <slusarz@horde.org>
19: * @category Horde
20: * @copyright 2010-2014 Horde LLC
21: * @license http://www.horde.org/licenses/gpl GPL
22: * @package IMP
23: */
24: class IMP_Factory_Mail extends Horde_Core_Factory_Mail
25: {
26: /**
27: */
28: public function create($config = null)
29: {
30: global $injector;
31:
32: list($transport, $params) = $this->getConfig();
33:
34: if ($transport == 'smtp') {
35: $params = array_merge(
36: $params,
37: $injector->getInstance('IMP_Factory_Imap')->create()->config->smtp
38: );
39: }
40:
41: return parent::create(array(
42: 'params' => $params,
43: 'transport' => $transport
44: ));
45: }
46:
47: }
48: