1: <?php
2: /**
3: * A Horde_Injector:: based Horde_Crypt:: factory.
4: *
5: * PHP version 5
6: *
7: * @category Horde
8: * @package Core
9: * @author Michael Slusarz <slusarz@horde.org>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Core
12: */
13:
14: /**
15: * A Horde_Injector:: based Horde_Crypt:: factory.
16: *
17: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you
20: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21: *
22: * @category Horde
23: * @package Core
24: * @author Michael Slusarz <slusarz@horde.org>
25: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26: * @link http://pear.horde.org/index.php?package=Core
27: */
28: class Horde_Core_Factory_Crypt extends Horde_Core_Factory_Base
29: {
30: /**
31: * Return the Horde_Crypt:: instance.
32: *
33: * @param string $driver The driver name.
34: * @param array $params Any parameters needed by the driver.
35: *
36: * @return Horde_Crypt The instance.
37: * @throws Horde_Exception
38: */
39: public function create($driver, $params = array())
40: {
41: global $registry;
42:
43: $params = array_merge(array(
44: 'email_charset' => $registry->getEmailCharset(),
45: 'temp' => Horde::getTempDir()
46: ), $params);
47:
48: return Horde_Crypt::factory($driver, $params);
49: }
50:
51: }
52: