1: <?php
2: /**
3: * Horde's Mail interface.
4: *
5: * LICENSE:
6: *
7: * Copyright (c) 2002-2007, Richard Heyes
8: * All rights reserved.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: *
14: * o Redistributions of source code must retain the above copyright
15: * notice, this list of conditions and the following disclaimer.
16: * o Redistributions in binary form must reproduce the above copyright
17: * notice, this list of conditions and the following disclaimer in the
18: * documentation and/or other materials provided with the distribution.
19: * o The names of the authors may not be used to endorse or promote
20: * products derived from this software without specific prior written
21: * permission.
22: *
23: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34: *
35: * @category Horde
36: * @package Mail
37: * @author Chuck Hagenbuch <chuck@horde.org>
38: * @author Michael Slusarz <slusarz@horde.org>
39: * @copyright 1997-2010 Chuck Hagenbuch
40: * @copyright 2010 Michael Slusarz
41: * @license http://www.horde.org/licenses/bsd New BSD License
42: */
43:
44: /**
45: * The Mail interface.
46: *
47: * @category Horde
48: * @package Mail
49: */
50: class Horde_Mail
51: {
52: /**
53: * Returns a Horde_Mail_Transport:: object.
54: *
55: * @param string $transport The transport to instantiate.
56: * @param array $params The parameters to pass to the transport.
57: *
58: * @return Horde_Mail_Transport The transport instance.
59: * @throws Horde_Mail_Exception
60: * @deprecated
61: */
62: static public function factory($transport, $params = array())
63: {
64: $class = 'Horde_Mail_Transport_' . ucfirst($transport);
65: if (class_exists($class)) {
66: return new $class($params);
67: }
68:
69: throw new Horde_Mail_Exception('Unable to find class for transport ' . $transport);
70: }
71:
72: }
73: