Warning, file /webapps/ocs-webserver/library/Zend/Log/Filter/Suppress.php was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 Filter
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_Filter_Interface */
0024 // require_once 'Zend/Log/Filter/Abstract.php';
0025 
0026 /**
0027  * @category   Zend
0028  * @package    Zend_Log
0029  * @subpackage Filter
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_Filter_Suppress extends Zend_Log_Filter_Abstract
0035 {
0036     /**
0037      * @var boolean
0038      */
0039     protected $_accept = true;
0040 
0041     /**
0042      * This is a simple boolean filter.
0043      *
0044      * Call suppress(true) to suppress all log events.
0045      * Call suppress(false) to accept all log events.
0046      *
0047      * @param  boolean  $suppress  Should all log events be suppressed?
0048      * @return  void
0049      */
0050     public function suppress($suppress)
0051     {
0052         $this->_accept = (! $suppress);
0053     }
0054 
0055     /**
0056      * Returns TRUE to accept the message, FALSE to block it.
0057      *
0058      * @param  array    $event    event data
0059      * @return boolean            accepted?
0060      */
0061     public function accept($event)
0062     {
0063         return $this->_accept;
0064     }
0065 
0066     /**
0067      * Create a new instance of Zend_Log_Filter_Suppress
0068      *
0069      * @param  array|Zend_Config $config
0070      * @return Zend_Log_Filter_Suppress
0071      * @throws Zend_Log_Exception
0072      */
0073     static public function factory($config)
0074     {
0075         return new self();
0076     }
0077 }