scramatte
unread,Aug 21, 2009, 3:17:22 PM8/21/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to concentre-daemon
I think that Zend_Config should not be included directly into
Zend_Daemon_Abstract. Instead we should add "options" parameters
something like this :
protected $_defaultOptions = array(
'key' => 'value',
);
protected $_options = array();
public function __construct(array $options=array())
{
$this->setOptions($options);
...
}
public function setOptions(array $options)
{
$diff = array_diff_key($options, $this->_defaultOptions);
if ($diff) {
list($key, $val) = each($diff);
require_once 'Concentre/Daemon/Exception.php';
throw new Concentre_Daemon_Exception(null, "Unknown
Concentre_Daemon option: $key");
}
foreach ($defaultOptions as $key => $val) {
if (!array_key_exists($key, $options)) {
$options[$key] = $val;
}
}
$this->_options = $options;
return $this;
}
Most of the ZF class use this (Zend_Db, Zend_Form , ...)