diff options
Diffstat (limited to 'libs/Zend/Log/Writer/Abstract.php')
-rw-r--r-- | libs/Zend/Log/Writer/Abstract.php | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/libs/Zend/Log/Writer/Abstract.php b/libs/Zend/Log/Writer/Abstract.php index 3e3be2d6cd..80b939db18 100644 --- a/libs/Zend/Log/Writer/Abstract.php +++ b/libs/Zend/Log/Writer/Abstract.php @@ -15,23 +15,23 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 16219 2009-06-21 19:45:39Z thomas $ + * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** Zend_Log_Filter_Priority */ -require_once 'Zend/Log/Filter/Priority.php'; +// require_once 'Zend/Log/Filter/Priority.php'; /** * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 16219 2009-06-21 19:45:39Z thomas $ + * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ */ -abstract class Zend_Log_Writer_Abstract +abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface { /** * @var array of Zend_Log_Filter_Interface @@ -104,4 +104,26 @@ abstract class Zend_Log_Writer_Abstract */ abstract protected function _write($event); -}
\ No newline at end of file + /** + * Validate and optionally convert the config to array + * + * @param array|Zend_Config $config Zend_Config or Array + * @return array + * @throws Zend_Log_Exception + */ + static protected function _parseConfig($config) + { + if ($config instanceof Zend_Config) { + $config = $config->toArray(); + } + + if (!is_array($config)) { + // require_once 'Zend/Log/Exception.php'; + throw new Zend_Log_Exception( + 'Configuration must be an array or instance of Zend_Config' + ); + } + + return $config; + } +} |