PageRenderTime 55ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Zend/Log/Filter/Abstract.php

https://bitbucket.org/hieronim1981/tunethemusic
PHP | 60 lines | 18 code | 5 blank | 37 comment | 2 complexity | 9d979eb9f67beaa0ce1a25224e9c9824 MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  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.
  14. *
  15. * @category Zend
  16. * @package Zend_Log
  17. * @subpackage Writer
  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
  20. * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
  21. */
  22. /** @see Zend_Log_Filter_Interface */
  23. require_once 'Zend/Log/Filter/Interface.php';
  24. /** @see Zend_Log_FactoryInterface */
  25. require_once 'Zend/Log/FactoryInterface.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Log
  29. * @subpackage Filter
  30. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
  33. */
  34. abstract class Zend_Log_Filter_Abstract
  35. implements Zend_Log_Filter_Interface, Zend_Log_FactoryInterface
  36. {
  37. /**
  38. * Validate and optionally convert the config to array
  39. *
  40. * @param array|Zend_Config $config Zend_Config or Array
  41. * @return array
  42. * @throws Zend_Log_Exception
  43. */
  44. static protected function _parseConfig($config)
  45. {
  46. if ($config instanceof Zend_Config) {
  47. $config = $config->toArray();
  48. }
  49. if (!is_array($config)) {
  50. require_once 'Zend/Log/Exception.php';
  51. throw new Zend_Log_Exception('Configuration must be an array or instance of Zend_Config');
  52. }
  53. return $config;
  54. }
  55. }