1: <?php
2: /**
3: * A Horde_Injector:: based Horde_LoginTasks:: 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_LoginTasks:: 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_LoginTasks extends Horde_Core_Factory_Base
29: {
30: /**
31: * Instances.
32: *
33: * @var array
34: */
35: private $_instances = array();
36:
37: /**
38: * Return the Horde_LoginTasks:: instance.
39: *
40: * @param string $app The current application.
41: *
42: * @return Horde_Core_LoginTasks|boolean The singleton instance. Returns
43: * false if logintasks not
44: * available.
45: */
46: public function create($app)
47: {
48: if (!$GLOBALS['registry']->getAuth()) {
49: return false;
50: }
51:
52: if (!isset($this->_instances[$app])) {
53: $this->_instances[$app] = new Horde_Core_LoginTasks(new Horde_Core_LoginTasks_Backend_Horde($app), $app);
54: }
55:
56: return $this->_instances[$app];
57: }
58:
59: }
60: