1: <?php
2: /**
3: * Small factory class for wrapping the injection of Horde_Share objects into
4: * the Horde_Share_Object objects. We must use $GLOBALS here instead of keeping
5: * a reference to the injector since this object will be serialized along with
6: * the Horde_Share_Object object.
7: *
8: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
9: *
10: * See the enclosed file COPYING for license information (LGPL). If you
11: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
12: *
13: * @category Horde
14: * @package Core
15: * @author Michael J. Rubinsky <mrubinsk@horde.org>
16: */
17: class Horde_Core_Share_FactoryCallback
18: {
19: protected $_app;
20: protected $_driver;
21:
22: public function __construct($app, $driver)
23: {
24: $this->_app = $app;
25: $this->_driver = $driver;
26: }
27:
28: public function create()
29: {
30: return $GLOBALS['injector']->getInstance('Horde_Core_Factory_ShareBase')->create($this->_app, $this->_driver);
31: }
32:
33: }
34: