equal
deleted
inserted
replaced
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_Tool |
16 * @package Zend_Tool |
17 * @subpackage Framework |
17 * @subpackage Framework |
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 * @version $Id: Config.php 20096 2010-01-06 02:05:09Z bkarwin $ |
20 * @version $Id: Config.php 24593 2012-01-05 20:35:02Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @category Zend |
24 * @category Zend |
25 * @package Zend_Tool |
25 * @package Zend_Tool |
26 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
26 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
27 * @license http://framework.zend.com/license/new-bsd New BSD License |
27 * @license http://framework.zend.com/license/new-bsd New BSD License |
28 */ |
28 */ |
29 class Zend_Tool_Framework_Client_Config |
29 class Zend_Tool_Framework_Client_Config |
30 { |
30 { |
31 |
31 |
70 throw new Zend_Tool_Framework_Client_Exception('Provided path to config ' . $configFilepath . ' does not exist'); |
70 throw new Zend_Tool_Framework_Client_Exception('Provided path to config ' . $configFilepath . ' does not exist'); |
71 } |
71 } |
72 |
72 |
73 $this->_configFilepath = $configFilepath; |
73 $this->_configFilepath = $configFilepath; |
74 $this->loadConfig($configFilepath); |
74 $this->loadConfig($configFilepath); |
75 |
75 |
76 return $this; |
76 return $this; |
77 } |
77 } |
78 |
78 |
79 /** |
79 /** |
80 * Load the configuration from the given path. |
80 * Load the configuration from the given path. |
81 * |
81 * |
82 * @param string $configFilepath |
82 * @param string $configFilepath |
83 */ |
83 */ |
84 protected function loadConfig($configFilepath) |
84 protected function loadConfig($configFilepath) |
85 { |
85 { |
86 $suffix = substr($configFilepath, -4); |
86 $suffix = substr($configFilepath, -4); |
106 } |
106 } |
107 } |
107 } |
108 |
108 |
109 /** |
109 /** |
110 * Return the filepath of the configuration. |
110 * Return the filepath of the configuration. |
111 * |
111 * |
112 * @return string |
112 * @return string |
113 */ |
113 */ |
114 public function getConfigFilepath() |
114 public function getConfigFilepath() |
115 { |
115 { |
116 return $this->_configFilepath; |
116 return $this->_configFilepath; |
117 } |
117 } |
118 |
118 |
119 /** |
119 /** |
120 * Get a configuration value. |
120 * Get a configuration value. |
121 * |
121 * |
122 * @param string $name |
122 * @param string $name |
123 * @param string $defaultValue |
123 * @param string $defaultValue |
124 * @return mixed |
124 * @return mixed |
125 */ |
125 */ |
126 public function get($name, $defaultValue=null) |
126 public function get($name, $defaultValue=null) |