File indexing completed on 2024-12-22 05:36:50
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Log 0017 * @subpackage Writer 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** Zend_Log_Writer_Abstract */ 0024 // require_once 'Zend/Log/Writer/Abstract.php'; 0025 0026 /** 0027 * @category Zend 0028 * @package Zend_Log 0029 * @subpackage Writer 0030 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0031 * @license http://framework.zend.com/license/new-bsd New BSD License 0032 * @version $Id$ 0033 */ 0034 class Zend_Log_Writer_Mock extends Zend_Log_Writer_Abstract 0035 { 0036 /** 0037 * array of log events 0038 * 0039 * @var array 0040 */ 0041 public $events = array(); 0042 0043 /** 0044 * shutdown called? 0045 * 0046 * @var boolean 0047 */ 0048 public $shutdown = false; 0049 0050 /** 0051 * Write a message to the log. 0052 * 0053 * @param array $event event data 0054 * @return void 0055 */ 0056 public function _write($event) 0057 { 0058 $this->events[] = $event; 0059 } 0060 0061 /** 0062 * Record shutdown 0063 * 0064 * @return void 0065 */ 0066 public function shutdown() 0067 { 0068 $this->shutdown = true; 0069 } 0070 0071 /** 0072 * Create a new instance of Zend_Log_Writer_Mock 0073 * 0074 * @param array|Zend_Config $config 0075 * @return Zend_Log_Writer_Mock 0076 */ 0077 static public function factory($config) 0078 { 0079 return new self(); 0080 } 0081 }