7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@zend.com so we can send you a copy immediately.
16
* @package Zend_Config
17
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
18
* @license http://framework.zend.com/license/new-bsd New BSD License
19
* @version $Id: Writer.php 12220 2008-10-31 20:13:55Z dasprid $
24
* @package Zend_Config
25
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
26
* @license http://framework.zend.com/license/new-bsd New BSD License
28
abstract class Zend_Config_Writer
31
* Option keys to skip when calling setOptions()
35
protected $_skipOptions = array(
40
* Config object to write
44
protected $_config = null;
47
* Create a new adapter
49
* $options can only be passed as array or be omitted
51
* @param null|array $options
53
public function __construct(array $options = null)
55
if (is_array($options)) {
56
$this->setOptions($options);
61
* Set options via a Zend_Config instance
63
* @param Zend_Config $config
64
* @return Zend_Config_Writer
66
public function setConfig(Zend_Config $config)
68
$this->_config = $config;
74
* Set options via an array
76
* @param array $options
77
* @return Zend_Config_Writer
79
public function setOptions(array $options)
81
foreach ($options as $key => $value) {
82
if (in_array(strtolower($key), $this->_skipOptions)) {
86
$method = 'set' . ucfirst($key);
87
if (method_exists($this, $method)) {
88
$this->$method($value);
96
* Write a Zend_Config object to it's target
100
abstract public function write();