1<?php 2/** 3 * Horde Log package 4 * 5 * This package is based on Zend_Log from the Zend Framework 6 * (http://framework.zend.com). Both that package and this 7 * one were written by Mike Naberezny and Chuck Hagenbuch. 8 * 9 * @author Mike Naberezny <mike@maintainable.com> 10 * @author Chuck Hagenbuch <chuck@horde.org> 11 * @category Horde 12 * @license http://www.horde.org/licenses/bsd BSD 13 * @package Log 14 * @subpackage Filters 15 */ 16 17/** 18 * @author Mike Naberezny <mike@maintainable.com> 19 * @author Chuck Hagenbuch <chuck@horde.org> 20 * @category Horde 21 * @license http://www.horde.org/licenses/bsd BSD 22 * @package Log 23 * @subpackage Filters 24 */ 25class Horde_Log_Filter_Suppress implements Horde_Log_Filter 26{ 27 /** 28 * Accept all events? 29 * 30 * @var boolean 31 */ 32 protected $_accept = Horde_Log_Filter::ACCEPT; 33 34 /** 35 * This is a simple boolean filter. 36 * 37 * @param boolean $suppress Should all log events be suppressed? 38 */ 39 public function suppress($suppress) 40 { 41 $this->_accept = !$suppress; 42 } 43 44 /** 45 * Returns Horde_Log_Filter::ACCEPT to accept the message, 46 * Horde_Log_Filter::IGNORE to ignore it. 47 * 48 * @param array $event Event data. 49 * 50 * @return boolean Accepted? 51 */ 52 public function accept($event) 53 { 54 return $this->_accept; 55 } 56 57} 58