13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Cloud |
16 * @package Zend_Cloud |
17 * @subpackage StorageService |
17 * @subpackage StorageService |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 */ |
20 */ |
21 |
21 |
22 require_once 'Zend/Cloud/AbstractFactory.php'; |
22 require_once 'Zend/Cloud/AbstractFactory.php'; |
23 |
23 |
24 /** |
24 /** |
25 * @category Zend |
25 * @category Zend |
26 * @package Zend_Cloud |
26 * @package Zend_Cloud |
27 * @subpackage StorageService |
27 * @subpackage StorageService |
28 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
28 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
29 * @license http://framework.zend.com/license/new-bsd New BSD License |
29 * @license http://framework.zend.com/license/new-bsd New BSD License |
30 */ |
30 */ |
31 class Zend_Cloud_StorageService_Factory extends Zend_Cloud_AbstractFactory |
31 class Zend_Cloud_StorageService_Factory extends Zend_Cloud_AbstractFactory |
32 { |
32 { |
33 const STORAGE_ADAPTER_KEY = 'storage_adapter'; |
33 const STORAGE_ADAPTER_KEY = 'storage_adapter'; |
34 |
34 |
35 /** |
35 /** |
36 * @var string Interface which adapter must implement to be considered valid |
36 * @var string Interface which adapter must implement to be considered valid |
37 */ |
37 */ |
38 protected static $_adapterInterface = 'Zend_Cloud_StorageService_Adapter'; |
38 protected static $_adapterInterface = 'Zend_Cloud_StorageService_Adapter'; |
39 /** |
39 /** |
40 * Constructor |
40 * Constructor |
41 * |
41 * |
42 * @return void |
42 * @return void |
43 */ |
43 */ |
44 private function __construct() |
44 private function __construct() |
45 { |
45 { |
46 // private ctor - should not be used |
46 // private ctor - should not be used |
47 } |
47 } |
48 |
48 |
49 /** |
49 /** |
50 * Retrieve StorageService adapter |
50 * Retrieve StorageService adapter |
51 * |
51 * |
52 * @param array $options |
52 * @param array $options |
53 * @return void |
53 * @return Zend_Cloud_StorageService_Adapter |
54 */ |
54 */ |
55 public static function getAdapter($options = array()) |
55 public static function getAdapter($options = array()) |
56 { |
56 { |
57 $adapter = parent::_getAdapter(self::STORAGE_ADAPTER_KEY, $options); |
57 $adapter = parent::_getAdapter(self::STORAGE_ADAPTER_KEY, $options); |
58 if (!$adapter) { |
58 if (!$adapter) { |
59 require_once 'Zend/Cloud/StorageService/Exception.php'; |
59 require_once 'Zend/Cloud/StorageService/Exception.php'; |
60 throw new Zend_Cloud_StorageService_Exception('Class must be specified using the \'' . |
60 throw new Zend_Cloud_StorageService_Exception('Class must be specified using the \'' . |