PageRenderTime 54ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Zend/Log/Writer/Mock.php

https://bitbucket.org/philkershaw/zend-framework-1.11-acl-implementation
PHP | 81 lines | 19 code | 6 blank | 56 comment | 0 complexity | b7af46d3e842dbb3e2c0d75a13ae66d0 MD5 | raw file
Possible License(s): LGPL-3.0
  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-2011 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: Mock.php 23775 2011-03-01 17:25:24Z ralph $
  21. */
  22. /** Zend_Log_Writer_Abstract */
  23. require_once 'Zend/Log/Writer/Abstract.php';
  24. /**
  25. * @category Zend
  26. * @package Zend_Log
  27. * @subpackage Writer
  28. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. * @version $Id: Mock.php 23775 2011-03-01 17:25:24Z ralph $
  31. */
  32. class Zend_Log_Writer_Mock extends Zend_Log_Writer_Abstract
  33. {
  34. /**
  35. * array of log events
  36. *
  37. * @var array
  38. */
  39. public $events = array();
  40. /**
  41. * shutdown called?
  42. *
  43. * @var boolean
  44. */
  45. public $shutdown = false;
  46. /**
  47. * Write a message to the log.
  48. *
  49. * @param array $event event data
  50. * @return void
  51. */
  52. public function _write($event)
  53. {
  54. $this->events[] = $event;
  55. }
  56. /**
  57. * Record shutdown
  58. *
  59. * @return void
  60. */
  61. public function shutdown()
  62. {
  63. $this->shutdown = true;
  64. }
  65. /**
  66. * Create a new instance of Zend_Log_Writer_Mock
  67. *
  68. * @param array|Zend_Config $config
  69. * @return Zend_Log_Writer_Mock
  70. */
  71. static public function factory($config)
  72. {
  73. return new self();
  74. }
  75. }